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_PERSONAL_OPTIONS_HANDLER_H_ | |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "chrome/browser/sync/profile_sync_service.h" | |
11 #include "chrome/browser/ui/webui/options/options_ui.h" | |
12 #if defined(OS_CHROMEOS) | |
13 #include "content/public/browser/notification_registrar.h" | |
14 #endif | |
15 | |
16 // Chrome personal options page UI handler. | |
17 class PersonalOptionsHandler : public OptionsPageUIHandler, | |
18 public ProfileSyncServiceObserver { | |
19 public: | |
20 PersonalOptionsHandler(); | |
21 virtual ~PersonalOptionsHandler(); | |
22 | |
23 // OptionsPageUIHandler implementation. | |
24 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; | |
25 virtual void InitializeHandler() OVERRIDE; | |
26 | |
27 // WebUIMessageHandler implementation. | |
28 virtual void RegisterMessages() OVERRIDE; | |
29 | |
30 // content::NotificationObserver implementation. | |
31 virtual void Observe(int type, | |
32 const content::NotificationSource& source, | |
33 const content::NotificationDetails& details) OVERRIDE; | |
34 | |
35 // ProfileSyncServiceObserver implementation. | |
36 virtual void OnStateChanged() OVERRIDE; | |
37 | |
38 private: | |
39 void ObserveThemeChanged(); | |
40 void ThemesReset(const ListValue* args); | |
41 #if defined(TOOLKIT_GTK) | |
42 void ThemesSetGTK(const ListValue* args); | |
43 #endif | |
44 | |
45 #if defined(OS_CHROMEOS) | |
46 void UpdateAccountPicture(); | |
47 content::NotificationRegistrar registrar_; | |
48 #endif | |
49 | |
50 // Sends an array of Profile objects to javascript. | |
51 // Each object is of the form: | |
52 // profileInfo = { | |
53 // name: "Profile Name", | |
54 // iconURL: "chrome://path/to/icon/image", | |
55 // filePath: "/path/to/profile/data/on/disk", | |
56 // isCurrentProfile: false | |
57 // }; | |
58 void SendProfilesInfo(); | |
59 | |
60 // Asynchronously opens a new browser window to create a new profile. | |
61 // |args| is not used. | |
62 void CreateProfile(const ListValue* args); | |
63 | |
64 // True if the multiprofiles switch is enabled. | |
65 bool multiprofile_; | |
66 | |
67 DISALLOW_COPY_AND_ASSIGN(PersonalOptionsHandler); | |
68 }; | |
69 | |
70 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ | |
OLD | NEW |