OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/webui/options/options_ui.h" | 9 #include "chrome/browser/ui/webui/options/options_ui.h" |
10 | 10 |
11 // Chrome personal stuff profiles manage overlay UI handler. | 11 // Chrome personal stuff profiles manage overlay UI handler. |
12 class ManageProfileHandler : public OptionsPageUIHandler { | 12 class ManageProfileHandler : public OptionsPageUIHandler { |
13 public: | 13 public: |
14 ManageProfileHandler(); | 14 ManageProfileHandler(); |
15 virtual ~ManageProfileHandler(); | 15 virtual ~ManageProfileHandler(); |
16 | 16 |
17 // OptionsPageUIHandler: | 17 // OptionsPageUIHandler: |
18 virtual void GetLocalizedValues(base::DictionaryValue* localized_strings); | 18 virtual void GetLocalizedValues(base::DictionaryValue* localized_strings); |
19 virtual void Initialize(); | 19 virtual void Initialize(); |
20 | 20 |
21 // WebUIMessageHandler: | 21 // WebUIMessageHandler: |
22 virtual void RegisterMessages(); | 22 virtual void RegisterMessages(); |
23 | 23 |
24 // NotificationObserver: | 24 // NotificationObserver: |
25 virtual void Observe(int type, | 25 virtual void Observe(int type, |
26 const NotificationSource& source, | 26 const NotificationSource& source, |
27 const NotificationDetails& details); | 27 const NotificationDetails& details); |
28 | 28 |
29 private: | 29 private: |
30 // Send the array of default profile icon URLs to WebUI. | 30 // Callback for the "requestDefaultProfileIcons" message. |
31 void InitializeDefaultProfileIcons(); | 31 // Sends the array of default profile icon URLs to WebUI. |
| 32 // |args| is of the form: [ {string} iconURL ] |
| 33 void RequestDefaultProfileIcons(const base::ListValue* args); |
32 | 34 |
33 // Sends an object to WebUI of the form: | 35 // Sends an object to WebUI of the form: |
34 // profileNames = { | 36 // profileNames = { |
35 // "Profile Name 1": true, | 37 // "Profile Name 1": true, |
36 // "Profile Name 2": true, | 38 // "Profile Name 2": true, |
37 // ... | 39 // ... |
38 // }; | 40 // }; |
39 // This is used to detect duplicate profile names. | 41 // This is used to detect duplicate profile names. |
40 void SendProfileNames(); | 42 void SendProfileNames(); |
41 | 43 |
42 // Callback for the "setProfileNameAndIcon" message. Sets the name and icon | 44 // Callback for the "setProfileNameAndIcon" message. Sets the name and icon |
43 // of a given profile. | 45 // of a given profile. |
44 // |args| is of the form: [ | 46 // |args| is of the form: [ |
45 // /*string*/ profileFilePath, | 47 // /*string*/ profileFilePath, |
46 // /*string*/ newProfileName, | 48 // /*string*/ newProfileName, |
47 // /*string*/ newProfileIconURL | 49 // /*string*/ newProfileIconURL |
48 // ] | 50 // ] |
49 void SetProfileNameAndIcon(const base::ListValue* args); | 51 void SetProfileNameAndIcon(const base::ListValue* args); |
50 | 52 |
51 // Callback for the "deleteProfile" message. Deletes the given profile. | 53 // Callback for the "deleteProfile" message. Deletes the given profile. |
52 // |args| is of the form: [ {string} profileFilePath ] | 54 // |args| is of the form: [ {string} profileFilePath ] |
53 void DeleteProfile(const base::ListValue* args); | 55 void DeleteProfile(const base::ListValue* args); |
54 | 56 |
| 57 // Callback for the "requestProfileInfo" message. |
| 58 // Given |args| of the form: [ {number} profileIndex ] |
| 59 // Sends an object to WebUI of the form: |
| 60 // profileInfo = { |
| 61 // name: "Profile Name", |
| 62 // iconURL: "chrome://path/to/icon/image", |
| 63 // filePath: "/path/to/profile/data/on/disk" |
| 64 // isCurrentProfile: false, |
| 65 // }; |
| 66 void RequestProfileInfo(const base::ListValue* args); |
| 67 |
55 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); | 68 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); |
56 }; | 69 }; |
57 | 70 |
58 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | 71 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ |
59 | |
OLD | NEW |