| 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_PERSONAL_OPTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "chrome/browser/browser_signin.h" | |
| 11 #include "chrome/browser/sync/profile_sync_service.h" | 10 #include "chrome/browser/sync/profile_sync_service.h" |
| 12 #include "chrome/browser/ui/webui/options/options_ui.h" | 11 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 13 #if defined(OS_CHROMEOS) | 12 #if defined(OS_CHROMEOS) |
| 14 #include "content/common/notification_registrar.h" | 13 #include "content/common/notification_registrar.h" |
| 15 #endif | 14 #endif |
| 16 | 15 |
| 17 // Chrome personal options page UI handler. | 16 // Chrome personal options page UI handler. |
| 18 class PersonalOptionsHandler : public OptionsPageUIHandler, | 17 class PersonalOptionsHandler : public OptionsPageUIHandler, |
| 19 public ProfileSyncServiceObserver, | 18 public ProfileSyncServiceObserver { |
| 20 public BrowserSignin::SigninDelegate { | |
| 21 public: | 19 public: |
| 22 PersonalOptionsHandler(); | 20 PersonalOptionsHandler(); |
| 23 virtual ~PersonalOptionsHandler(); | 21 virtual ~PersonalOptionsHandler(); |
| 24 | 22 |
| 25 // OptionsPageUIHandler implementation. | 23 // OptionsPageUIHandler implementation. |
| 26 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | 24 virtual void GetLocalizedValues(DictionaryValue* localized_strings); |
| 27 virtual void Initialize(); | 25 virtual void Initialize(); |
| 28 | 26 |
| 29 // WebUIMessageHandler implementation. | 27 // WebUIMessageHandler implementation. |
| 30 virtual void RegisterMessages(); | 28 virtual void RegisterMessages(); |
| 31 | 29 |
| 32 // NotificationObserver implementation. | 30 // NotificationObserver implementation. |
| 33 virtual void Observe(int type, | 31 virtual void Observe(int type, |
| 34 const NotificationSource& source, | 32 const NotificationSource& source, |
| 35 const NotificationDetails& details); | 33 const NotificationDetails& details); |
| 36 | 34 |
| 37 // ProfileSyncServiceObserver implementation. | 35 // ProfileSyncServiceObserver implementation. |
| 38 virtual void OnStateChanged(); | 36 virtual void OnStateChanged(); |
| 39 | 37 |
| 40 // BrowserSignin::SigninDelegate implementation. | |
| 41 virtual void OnLoginSuccess(); | |
| 42 virtual void OnLoginFailure(const GoogleServiceAuthError& error); | |
| 43 | |
| 44 private: | 38 private: |
| 45 void ObserveThemeChanged(); | 39 void ObserveThemeChanged(); |
| 46 void ThemesReset(const ListValue* args); | 40 void ThemesReset(const ListValue* args); |
| 47 #if defined(TOOLKIT_GTK) | 41 #if defined(TOOLKIT_GTK) |
| 48 void ThemesSetGTK(const ListValue* args); | 42 void ThemesSetGTK(const ListValue* args); |
| 49 #endif | 43 #endif |
| 50 | 44 |
| 51 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
| 52 void LoadAccountPicture(const ListValue* args); | 46 void LoadAccountPicture(const ListValue* args); |
| 53 NotificationRegistrar registrar_; | 47 NotificationRegistrar registrar_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 67 // |args| is not used. | 61 // |args| is not used. |
| 68 void CreateProfile(const ListValue* args); | 62 void CreateProfile(const ListValue* args); |
| 69 | 63 |
| 70 // True if the multiprofiles switch is enabled. | 64 // True if the multiprofiles switch is enabled. |
| 71 bool multiprofile_; | 65 bool multiprofile_; |
| 72 | 66 |
| 73 DISALLOW_COPY_AND_ASSIGN(PersonalOptionsHandler); | 67 DISALLOW_COPY_AND_ASSIGN(PersonalOptionsHandler); |
| 74 }; | 68 }; |
| 75 | 69 |
| 76 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ | 70 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ |
| OLD | NEW |