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