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> | |
9 | |
10 #include "base/memory/weak_ptr.h" | |
8 #include "chrome/browser/ui/webui/options/options_ui.h" | 11 #include "chrome/browser/ui/webui/options/options_ui.h" |
9 | 12 |
10 namespace base { | 13 namespace base { |
11 class StringValue; | 14 class StringValue; |
12 } | 15 } |
13 | 16 |
14 namespace options { | 17 namespace options { |
15 | 18 |
16 // Chrome personal stuff profiles manage overlay UI handler. | 19 // Chrome personal stuff profiles manage overlay UI handler. |
17 class ManageProfileHandler : public OptionsPageUIHandler { | 20 class ManageProfileHandler : public OptionsPageUIHandler { |
(...skipping 19 matching lines...) Expand all Loading... | |
37 // Callback for the "requestDefaultProfileIcons" message. | 40 // Callback for the "requestDefaultProfileIcons" message. |
38 // Sends the array of default profile icon URLs to WebUI. | 41 // Sends the array of default profile icon URLs to WebUI. |
39 // |args| is of the form: [ {string} iconURL ] | 42 // |args| is of the form: [ {string} iconURL ] |
40 void RequestDefaultProfileIcons(const base::ListValue* args); | 43 void RequestDefaultProfileIcons(const base::ListValue* args); |
41 | 44 |
42 // Callback for the "requestNewProfileDefaults" message. | 45 // Callback for the "requestNewProfileDefaults" message. |
43 // Sends an object to WebUI of the form: | 46 // Sends an object to WebUI of the form: |
44 // { "name": profileName, "iconURL": iconURL } | 47 // { "name": profileName, "iconURL": iconURL } |
45 void RequestNewProfileDefaults(const base::ListValue* args); | 48 void RequestNewProfileDefaults(const base::ListValue* args); |
46 | 49 |
50 // Send all profile icons to the overlay. | |
51 // |iconGrid| is the string representation of which grid the icons will | |
James Hawkins
2013/01/09 20:54:58
Phrasing is a little hard to read, consider:
...i
Alexei Svitkine (slow)
2013/01/09 21:54:15
My CL was actually just moving this around to matc
| |
52 // populate (i.e. "create-profile-icon-grid" or "manage-profile-icon-grid"). | |
53 void SendProfileIcons(const base::StringValue& icon_grid); | |
54 | |
47 // Sends an object to WebUI of the form: | 55 // Sends an object to WebUI of the form: |
48 // profileNames = { | 56 // profileNames = { |
49 // "Profile Name 1": true, | 57 // "Profile Name 1": true, |
50 // "Profile Name 2": true, | 58 // "Profile Name 2": true, |
51 // ... | 59 // ... |
52 // }; | 60 // }; |
53 // This is used to detect duplicate profile names. | 61 // This is used to detect duplicate profile names. |
54 void SendProfileNames(); | 62 void SendProfileNames(); |
55 | 63 |
56 // Callback for the "setProfileNameAndIcon" message. Sets the name and icon | 64 // Callback for the "setProfileNameAndIcon" message. Sets the name and icon |
57 // of a given profile. | 65 // of a given profile. |
58 // |args| is of the form: [ | 66 // |args| is of the form: [ |
59 // /*string*/ profileFilePath, | 67 // /*string*/ profileFilePath, |
60 // /*string*/ newProfileName, | 68 // /*string*/ newProfileName, |
61 // /*string*/ newProfileIconURL | 69 // /*string*/ newProfileIconURL |
62 // ] | 70 // ] |
63 void SetProfileNameAndIcon(const base::ListValue* args); | 71 void SetProfileNameAndIcon(const base::ListValue* args); |
64 | 72 |
65 // Callback for the "deleteProfile" message. Deletes the given profile. | 73 // Callback for the "deleteProfile" message. Deletes the given profile. |
66 // |args| is of the form: [ {string} profileFilePath ] | 74 // |args| is of the form: [ {string} profileFilePath ] |
67 void DeleteProfile(const base::ListValue* args); | 75 void DeleteProfile(const base::ListValue* args); |
68 | 76 |
69 // Callback for the 'profileIconSelectionChanged' message. Used to update the | 77 // Callback for the 'profileIconSelectionChanged' message. Used to update the |
70 // name in the manager profile dialog based on the selected icon. | 78 // name in the manager profile dialog based on the selected icon. |
71 void ProfileIconSelectionChanged(const base::ListValue* args); | 79 void ProfileIconSelectionChanged(const base::ListValue* args); |
72 | 80 |
73 // Send all profile icons to the overlay. | 81 // Callback for the "requestHasProfileShortcuts" message, which is called |
74 // |iconGrid| is the string representation of which grid the icons will | 82 // when editing an existing profile. Asks the profile shortcut manager whether |
75 // populate (i.e. "create-profile-icon-grid" or "manage-profile-icon-grid"). | 83 // the profile has shortcuts and gets the result in |OnHasProfileShortcuts()|. |
76 void SendProfileIcons(const base::StringValue& icon_grid); | 84 void RequestHasProfileShortcuts(const base::ListValue* args); |
James Hawkins
2013/01/09 20:54:58
Document args.
Alexei Svitkine (slow)
2013/01/09 21:54:15
Done.
| |
85 | |
86 // Callback invoked from the profile manager indicating whether the profile | |
87 // being edited has any desktop shortcuts. | |
88 void OnHasProfileShortcuts(bool has_shortcuts); | |
77 | 89 |
78 // URL for the current profile's GAIA picture. | 90 // URL for the current profile's GAIA picture. |
79 std::string gaia_picture_url_; | 91 std::string gaia_picture_url_; |
80 | 92 |
93 // For generating weak pointers to itself for callbacks. | |
94 base::WeakPtrFactory<ManageProfileHandler> weak_factory_; | |
95 | |
81 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); | 96 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); |
82 }; | 97 }; |
83 | 98 |
84 } // namespace options | 99 } // namespace options |
85 | 100 |
86 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | 101 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ |
OLD | NEW |