OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/prefs/pref_change_registrar.h" | 11 #include "base/prefs/pref_change_registrar.h" |
| 12 #include "chrome/browser/sync/profile_sync_service_observer.h" |
12 #include "chrome/browser/ui/webui/options/options_ui.h" | 13 #include "chrome/browser/ui/webui/options/options_ui.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class StringValue; | 16 class StringValue; |
16 } | 17 } |
17 | 18 |
18 namespace options { | 19 namespace options { |
19 | 20 |
20 // Chrome personal stuff profiles manage overlay UI handler. | 21 // Chrome personal stuff profiles manage overlay UI handler. |
21 class ManageProfileHandler : public OptionsPageUIHandler { | 22 class ManageProfileHandler : public OptionsPageUIHandler, |
| 23 public ProfileSyncServiceObserver { |
22 public: | 24 public: |
23 ManageProfileHandler(); | 25 ManageProfileHandler(); |
24 virtual ~ManageProfileHandler(); | 26 virtual ~ManageProfileHandler(); |
25 | 27 |
26 // OptionsPageUIHandler: | 28 // OptionsPageUIHandler: |
27 virtual void GetLocalizedValues( | 29 virtual void GetLocalizedValues( |
28 base::DictionaryValue* localized_strings) OVERRIDE; | 30 base::DictionaryValue* localized_strings) OVERRIDE; |
29 virtual void InitializeHandler() OVERRIDE; | 31 virtual void InitializeHandler() OVERRIDE; |
30 virtual void InitializePage() OVERRIDE; | 32 virtual void InitializePage() OVERRIDE; |
31 | 33 |
32 // WebUIMessageHandler: | 34 // WebUIMessageHandler: |
33 virtual void RegisterMessages() OVERRIDE; | 35 virtual void RegisterMessages() OVERRIDE; |
34 | 36 |
35 // content::NotificationObserver: | 37 // content::NotificationObserver: |
36 virtual void Observe(int type, | 38 virtual void Observe(int type, |
37 const content::NotificationSource& source, | 39 const content::NotificationSource& source, |
38 const content::NotificationDetails& details) OVERRIDE; | 40 const content::NotificationDetails& details) OVERRIDE; |
39 | 41 |
| 42 // ProfileSyncServiceObserver: |
| 43 virtual void OnStateChanged() OVERRIDE; |
| 44 |
40 private: | 45 private: |
41 // Callback for the "requestDefaultProfileIcons" message. | 46 // Callback for the "requestDefaultProfileIcons" message. |
42 // Sends the array of default profile icon URLs to WebUI. | 47 // Sends the array of default profile icon URLs to WebUI. |
43 // |args| is of the form: [ {string} iconURL ] | 48 // |args| is of the form: [ {string} iconURL ] |
44 void RequestDefaultProfileIcons(const base::ListValue* args); | 49 void RequestDefaultProfileIcons(const base::ListValue* args); |
45 | 50 |
46 // Callback for the "requestNewProfileDefaults" message. | 51 // Callback for the "requestNewProfileDefaults" message. |
47 // Sends an object to WebUI of the form: | 52 // Sends an object to WebUI of the form: |
48 // { "name": profileName, "iconURL": iconURL } | 53 // { "name": profileName, "iconURL": iconURL } |
49 void RequestNewProfileDefaults(const base::ListValue* args); | 54 void RequestNewProfileDefaults(const base::ListValue* args); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // Used to observe the preference that allows creating managed users, which | 138 // Used to observe the preference that allows creating managed users, which |
134 // can be changed by policy. | 139 // can be changed by policy. |
135 PrefChangeRegistrar pref_change_registrar_; | 140 PrefChangeRegistrar pref_change_registrar_; |
136 | 141 |
137 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); | 142 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); |
138 }; | 143 }; |
139 | 144 |
140 } // namespace options | 145 } // namespace options |
141 | 146 |
142 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | 147 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ |
OLD | NEW |