[email protected] | 68c7630b | 2012-05-02 22:37:42 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 265a149 | 2011-02-27 05:58:07 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_UI_WEBUI_FLAGS_UI_H_ |
6 | #define CHROME_BROWSER_UI_WEBUI_FLAGS_UI_H_ | ||||
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 7 | |
[email protected] | 83d2c39 | 2013-03-06 16:26:56 | [diff] [blame] | 8 | #include "base/memory/weak_ptr.h" |
[email protected] | e14c95912 | 2012-01-13 16:58:25 | [diff] [blame] | 9 | #include "content/public/browser/web_ui_controller.h" |
[email protected] | 5e00969 | 2012-09-05 15:50:05 | [diff] [blame] | 10 | #include "ui/base/layout.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 11 | |
[email protected] | 3166220 | 2013-03-23 19:10:54 | [diff] [blame] | 12 | #if defined(OS_CHROMEOS) |
[email protected] | 83d2c39 | 2013-03-06 16:26:56 | [diff] [blame] | 13 | #include "chrome/browser/chromeos/settings/device_settings_service.h" |
14 | #endif | ||||
15 | |||||
[email protected] | b1de2c7 | 2013-02-06 02:45:47 | [diff] [blame] | 16 | class PrefRegistrySimple; |
[email protected] | 83d2c39 | 2013-03-06 16:26:56 | [diff] [blame] | 17 | class Profile; |
[email protected] | 68c7630b | 2012-05-02 22:37:42 | [diff] [blame] | 18 | |
19 | namespace base { | ||||
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 20 | class RefCountedMemory; |
[email protected] | 68c7630b | 2012-05-02 22:37:42 | [diff] [blame] | 21 | } |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 22 | |
[email protected] | 443e931 | 2013-05-06 06:17:34 | [diff] [blame] | 23 | namespace user_prefs { |
24 | class PrefRegistrySyncable; | ||||
25 | } | ||||
26 | |||||
[email protected] | c63cedf2 | 2012-01-17 18:42:22 | [diff] [blame] | 27 | class FlagsUI : public content::WebUIController { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 28 | public: |
[email protected] | 01ec4ec | 2012-01-18 04:13:47 | [diff] [blame] | 29 | explicit FlagsUI(content::WebUI* web_ui); |
[email protected] | 83d2c39 | 2013-03-06 16:26:56 | [diff] [blame] | 30 | virtual ~FlagsUI(); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 31 | |
[email protected] | 5e00969 | 2012-09-05 15:50:05 | [diff] [blame] | 32 | static base::RefCountedMemory* GetFaviconResourceBytes( |
33 | ui::ScaleFactor scale_factor); | ||||
[email protected] | b1de2c7 | 2013-02-06 02:45:47 | [diff] [blame] | 34 | static void RegisterPrefs(PrefRegistrySimple* registry); |
[email protected] | 3166220 | 2013-03-23 19:10:54 | [diff] [blame] | 35 | #if defined(OS_CHROMEOS) |
[email protected] | 443e931 | 2013-05-06 06:17:34 | [diff] [blame] | 36 | static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
[email protected] | 83d2c39 | 2013-03-06 16:26:56 | [diff] [blame] | 37 | #endif |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 38 | |
39 | private: | ||||
[email protected] | 3166220 | 2013-03-23 19:10:54 | [diff] [blame] | 40 | #if defined(OS_CHROMEOS) |
[email protected] | 83d2c39 | 2013-03-06 16:26:56 | [diff] [blame] | 41 | // On ChromeOS verifying if the owner is signed in is async operation and only |
42 | // after finishing it the UI can be properly populated. This function is the | ||||
43 | // callback for whether the owner is signed in. It will respectively pick the | ||||
44 | // proper PrefService for the flags interface. | ||||
45 | void FinishInitialization( | ||||
46 | Profile* profile, | ||||
47 | chromeos::DeviceSettingsService::OwnershipStatus status, | ||||
48 | bool current_user_is_owner); | ||||
49 | #endif | ||||
50 | base::WeakPtrFactory<FlagsUI> weak_factory_; | ||||
51 | |||||
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 52 | DISALLOW_COPY_AND_ASSIGN(FlagsUI); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 53 | }; |
54 | |||||
[email protected] | 265a149 | 2011-02-27 05:58:07 | [diff] [blame] | 55 | #endif // CHROME_BROWSER_UI_WEBUI_FLAGS_UI_H_ |