| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_DOM_UI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_DOM_UI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/browser_signin.h" |
| 9 #include "chrome/browser/dom_ui/options/options_ui.h" | 10 #include "chrome/browser/dom_ui/options/options_ui.h" |
| 10 #include "chrome/browser/sync/profile_sync_service.h" | 11 #include "chrome/browser/sync/profile_sync_service.h" |
| 11 | 12 |
| 12 class OptionsManagedBannerHandler; | 13 class OptionsManagedBannerHandler; |
| 13 | 14 |
| 14 // Chrome personal options page UI handler. | 15 // Chrome personal options page UI handler. |
| 15 class PersonalOptionsHandler : public OptionsPageUIHandler, | 16 class PersonalOptionsHandler : public OptionsPageUIHandler, |
| 16 public ProfileSyncServiceObserver { | 17 public ProfileSyncServiceObserver, |
| 18 public BrowserSignin::SigninDelegate { |
| 17 public: | 19 public: |
| 18 PersonalOptionsHandler(); | 20 PersonalOptionsHandler(); |
| 19 virtual ~PersonalOptionsHandler(); | 21 virtual ~PersonalOptionsHandler(); |
| 20 | 22 |
| 21 // OptionsUIHandler implementation. | 23 // OptionsUIHandler implementation. |
| 22 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | 24 virtual void GetLocalizedValues(DictionaryValue* localized_strings); |
| 23 virtual void Initialize(); | 25 virtual void Initialize(); |
| 24 | 26 |
| 25 // DOMMessageHandler implementation. | 27 // DOMMessageHandler implementation. |
| 26 virtual void RegisterMessages(); | 28 virtual void RegisterMessages(); |
| 27 | 29 |
| 28 // NotificationObserver implementation. | 30 // NotificationObserver implementation. |
| 29 virtual void Observe(NotificationType type, | 31 virtual void Observe(NotificationType type, |
| 30 const NotificationSource& source, | 32 const NotificationSource& source, |
| 31 const NotificationDetails& details); | 33 const NotificationDetails& details); |
| 32 | 34 |
| 33 // ProfileSyncServiceObserver implementation. | 35 // ProfileSyncServiceObserver implementation. |
| 34 virtual void OnStateChanged(); | 36 virtual void OnStateChanged(); |
| 35 | 37 |
| 38 // BrowserSignin::SigninDelegate implementation. |
| 39 virtual void OnLoginSuccess(); |
| 40 virtual void OnLoginFailure(const GoogleServiceAuthError& error); |
| 41 |
| 36 private: | 42 private: |
| 37 void ObserveThemeChanged(); | 43 void ObserveThemeChanged(); |
| 38 void ShowSyncLoginDialog(const ListValue* args); | 44 void ShowSyncLoginDialog(const ListValue* args); |
| 39 void ThemesReset(const ListValue* args); | 45 void ThemesReset(const ListValue* args); |
| 40 #if defined(TOOLKIT_GTK) | 46 #if defined(TOOLKIT_GTK) |
| 41 void ThemesSetGTK(const ListValue* args); | 47 void ThemesSetGTK(const ListValue* args); |
| 42 #endif | 48 #endif |
| 43 | 49 |
| 44 scoped_ptr<OptionsManagedBannerHandler> banner_handler_; | 50 scoped_ptr<OptionsManagedBannerHandler> banner_handler_; |
| 45 | 51 |
| 46 DISALLOW_COPY_AND_ASSIGN(PersonalOptionsHandler); | 52 DISALLOW_COPY_AND_ASSIGN(PersonalOptionsHandler); |
| 47 }; | 53 }; |
| 48 | 54 |
| 49 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ | 55 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ |
| OLD | NEW |