| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/browser/ui/webui/options/options_ui.h" | |
| 10 | |
| 11 // Chrome personal stuff profiles manage overlay UI handler. | |
| 12 class ManageProfileHandler : public OptionsPageUIHandler { | |
| 13 public: | |
| 14 ManageProfileHandler(); | |
| 15 virtual ~ManageProfileHandler(); | |
| 16 | |
| 17 // OptionsPageUIHandler: | |
| 18 virtual void GetLocalizedValues( | |
| 19 base::DictionaryValue* localized_strings) OVERRIDE; | |
| 20 virtual void InitializeHandler() OVERRIDE; | |
| 21 | |
| 22 // WebUIMessageHandler: | |
| 23 virtual void RegisterMessages() OVERRIDE; | |
| 24 | |
| 25 // content::NotificationObserver: | |
| 26 virtual void Observe(int type, | |
| 27 const content::NotificationSource& source, | |
| 28 const content::NotificationDetails& details) OVERRIDE; | |
| 29 | |
| 30 private: | |
| 31 // Callback for the "requestDefaultProfileIcons" message. | |
| 32 // Sends the array of default profile icon URLs to WebUI. | |
| 33 // |args| is of the form: [ {string} iconURL ] | |
| 34 void RequestDefaultProfileIcons(const base::ListValue* args); | |
| 35 | |
| 36 // Sends an object to WebUI of the form: | |
| 37 // profileNames = { | |
| 38 // "Profile Name 1": true, | |
| 39 // "Profile Name 2": true, | |
| 40 // ... | |
| 41 // }; | |
| 42 // This is used to detect duplicate profile names. | |
| 43 void SendProfileNames(); | |
| 44 | |
| 45 // Callback for the "setProfileNameAndIcon" message. Sets the name and icon | |
| 46 // of a given profile. | |
| 47 // |args| is of the form: [ | |
| 48 // /*string*/ profileFilePath, | |
| 49 // /*string*/ newProfileName, | |
| 50 // /*string*/ newProfileIconURL | |
| 51 // ] | |
| 52 void SetProfileNameAndIcon(const base::ListValue* args); | |
| 53 | |
| 54 // Callback for the "deleteProfile" message. Deletes the given profile. | |
| 55 // |args| is of the form: [ {string} profileFilePath ] | |
| 56 void DeleteProfile(const base::ListValue* args); | |
| 57 | |
| 58 // Callback for the "requestProfileInfo" message. | |
| 59 // Given |args| of the form: [ {number} profileIndex ] | |
| 60 // Sends an object to WebUI of the form: | |
| 61 // profileInfo = { | |
| 62 // name: "Profile Name", | |
| 63 // iconURL: "chrome://path/to/icon/image", | |
| 64 // filePath: "/path/to/profile/data/on/disk" | |
| 65 // isCurrentProfile: false, | |
| 66 // }; | |
| 67 void RequestProfileInfo(const base::ListValue* args); | |
| 68 | |
| 69 // Callback for the 'profileIconSelectionChanged' message. Used to update the | |
| 70 // name in the manager profile dialog based on the selected icon. | |
| 71 void ProfileIconSelectionChanged(const base::ListValue* args); | |
| 72 | |
| 73 // Send all profile icons to the overlay. | |
| 74 void SendProfileIcons(); | |
| 75 | |
| 76 // URL for the current profile's GAIA picture. | |
| 77 std::string gaia_picture_url_; | |
| 78 | |
| 79 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); | |
| 80 }; | |
| 81 | |
| 82 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | |
| OLD | NEW |