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/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "chrome/browser/profiles/profile_attributes_storage.h" | 12 #include "chrome/browser/profiles/profile_attributes_storage.h" |
13 #include "chrome/browser/ui/webui/options/options_ui.h" | 13 #include "chrome/browser/ui/webui/options/options_ui.h" |
14 #include "components/prefs/pref_change_registrar.h" | 14 #include "components/prefs/pref_change_registrar.h" |
15 #include "components/sync/driver/sync_service_observer.h" | 15 #include "components/sync/driver/sync_service_observer.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class Value; | 18 class Value; |
19 using StringValue = Value; | |
20 } | 19 } |
21 | 20 |
22 namespace options { | 21 namespace options { |
23 | 22 |
24 // Chrome personal stuff profiles manage overlay UI handler. | 23 // Chrome personal stuff profiles manage overlay UI handler. |
25 class ManageProfileHandler : public OptionsPageUIHandler, | 24 class ManageProfileHandler : public OptionsPageUIHandler, |
26 public ProfileAttributesStorage::Observer, | 25 public ProfileAttributesStorage::Observer, |
27 public syncer::SyncServiceObserver { | 26 public syncer::SyncServiceObserver { |
28 public: | 27 public: |
29 ManageProfileHandler(); | 28 ManageProfileHandler(); |
(...skipping 28 matching lines...) Expand all Loading... |
58 // First item of |args| is the dialog mode, i.e. "create" or "manage". | 57 // First item of |args| is the dialog mode, i.e. "create" or "manage". |
59 void RequestDefaultProfileIcons(const base::ListValue* args); | 58 void RequestDefaultProfileIcons(const base::ListValue* args); |
60 | 59 |
61 // Callback for the "requestNewProfileDefaults" message. | 60 // Callback for the "requestNewProfileDefaults" message. |
62 // Sends an object to WebUI of the form: | 61 // Sends an object to WebUI of the form: |
63 // { "name": profileName, "iconURL": iconURL } | 62 // { "name": profileName, "iconURL": iconURL } |
64 void RequestNewProfileDefaults(const base::ListValue* args); | 63 void RequestNewProfileDefaults(const base::ListValue* args); |
65 | 64 |
66 // Send all profile icons and their default names to the overlay. | 65 // Send all profile icons and their default names to the overlay. |
67 // |mode| is the dialog mode, i.e. "create" or "manage". | 66 // |mode| is the dialog mode, i.e. "create" or "manage". |
68 void SendProfileIconsAndNames(const base::StringValue& mode); | 67 void SendProfileIconsAndNames(const base::Value& mode); |
69 | 68 |
70 // Sends an object to WebUI of the form: | 69 // Sends an object to WebUI of the form: |
71 // profileNames = { | 70 // profileNames = { |
72 // "Profile Name 1": true, | 71 // "Profile Name 1": true, |
73 // "Profile Name 2": true, | 72 // "Profile Name 2": true, |
74 // ... | 73 // ... |
75 // }; | 74 // }; |
76 // This is used to detect duplicate profile names. | 75 // This is used to detect duplicate profile names. |
77 void SendExistingProfileNames(); | 76 void SendExistingProfileNames(); |
78 | 77 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 135 |
137 // For generating weak pointers to itself for callbacks. | 136 // For generating weak pointers to itself for callbacks. |
138 base::WeakPtrFactory<ManageProfileHandler> weak_factory_; | 137 base::WeakPtrFactory<ManageProfileHandler> weak_factory_; |
139 | 138 |
140 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); | 139 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); |
141 }; | 140 }; |
142 | 141 |
143 } // namespace options | 142 } // namespace options |
144 | 143 |
145 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | 144 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ |
OLD | NEW |