OLD | NEW |
(Empty) | |
| 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 |
| 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(base::DictionaryValue* localized_strings); |
| 19 virtual void Initialize(); |
| 20 |
| 21 // WebUIMessageHandler: |
| 22 virtual void RegisterMessages(); |
| 23 |
| 24 // NotificationObserver: |
| 25 virtual void Observe(int type, |
| 26 const NotificationSource& source, |
| 27 const NotificationDetails& details); |
| 28 |
| 29 private: |
| 30 // Send the array of default profile icon URLs to WebUI. |
| 31 void InitializeDefaultProfileIcons(); |
| 32 |
| 33 // Sends an object to WebUI of the form: |
| 34 // profileNames = { |
| 35 // "Profile Name 1": true, |
| 36 // "Profile Name 2": true, |
| 37 // ... |
| 38 // }; |
| 39 // This is used to detect duplicate profile names. |
| 40 void SendProfileNames(); |
| 41 |
| 42 // Callback for the "setProfileNameAndIcon" message. Sets the name and icon |
| 43 // of a given profile. |
| 44 // |args| is of the form: [ |
| 45 // /*string*/ profileFilePath, |
| 46 // /*string*/ newProfileName, |
| 47 // /*string*/ newProfileIconURL |
| 48 // ] |
| 49 void SetProfileNameAndIcon(const base::ListValue* args); |
| 50 |
| 51 // Callback for the "deleteProfile" message. Deletes the given profile. |
| 52 // |args| is of the form: [ {string} profileFilePath ] |
| 53 void DeleteProfile(const base::ListValue* args); |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); |
| 56 }; |
| 57 |
| 58 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ |
| 59 |
OLD | NEW |