| OLD | NEW |
| 1 // Copyright (c) 2010 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_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/browser_signin.h" |
| 10 #include "chrome/browser/dom_ui/options/options_ui.h" | 10 #include "chrome/browser/dom_ui/options/options_ui.h" |
| 11 #include "chrome/browser/sync/profile_sync_service.h" | 11 #include "chrome/browser/sync/profile_sync_service.h" |
| 12 | 12 |
| 13 class OptionsManagedBannerHandler; | 13 class OptionsManagedBannerHandler; |
| 14 | 14 |
| 15 // Chrome personal options page UI handler. | 15 // Chrome personal options page UI handler. |
| 16 class PersonalOptionsHandler : public OptionsPageUIHandler, | 16 class PersonalOptionsHandler : public OptionsPageUIHandler, |
| 17 public ProfileSyncServiceObserver, | 17 public ProfileSyncServiceObserver, |
| 18 public BrowserSignin::SigninDelegate { | 18 public BrowserSignin::SigninDelegate { |
| 19 public: | 19 public: |
| 20 PersonalOptionsHandler(); | 20 PersonalOptionsHandler(); |
| 21 virtual ~PersonalOptionsHandler(); | 21 virtual ~PersonalOptionsHandler(); |
| 22 | 22 |
| 23 // OptionsUIHandler implementation. | 23 // OptionsUIHandler implementation. |
| 24 virtual bool IsEnabled(); |
| 24 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | 25 virtual void GetLocalizedValues(DictionaryValue* localized_strings); |
| 25 virtual void Initialize(); | 26 virtual void Initialize(); |
| 26 | 27 |
| 27 // DOMMessageHandler implementation. | 28 // DOMMessageHandler implementation. |
| 28 virtual void RegisterMessages(); | 29 virtual void RegisterMessages(); |
| 29 | 30 |
| 30 // NotificationObserver implementation. | 31 // NotificationObserver implementation. |
| 31 virtual void Observe(NotificationType type, | 32 virtual void Observe(NotificationType type, |
| 32 const NotificationSource& source, | 33 const NotificationSource& source, |
| 33 const NotificationDetails& details); | 34 const NotificationDetails& details); |
| 34 | 35 |
| 35 // ProfileSyncServiceObserver implementation. | 36 // ProfileSyncServiceObserver implementation. |
| 36 virtual void OnStateChanged(); | 37 virtual void OnStateChanged(); |
| 37 | 38 |
| 38 // BrowserSignin::SigninDelegate implementation. | 39 // BrowserSignin::SigninDelegate implementation. |
| 39 virtual void OnLoginSuccess(); | 40 virtual void OnLoginSuccess(); |
| 40 virtual void OnLoginFailure(const GoogleServiceAuthError& error); | 41 virtual void OnLoginFailure(const GoogleServiceAuthError& error); |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 void ObserveThemeChanged(); | 44 void ObserveThemeChanged(); |
| 44 void ShowSyncLoginDialog(const ListValue* args); | 45 void ShowSyncLoginDialog(const ListValue* args); |
| 45 void ThemesReset(const ListValue* args); | 46 void ThemesReset(const ListValue* args); |
| 46 #if defined(TOOLKIT_GTK) | 47 #if defined(TOOLKIT_GTK) |
| 47 void ThemesSetGTK(const ListValue* args); | 48 void ThemesSetGTK(const ListValue* args); |
| 48 #endif | 49 #endif |
| 49 | 50 |
| 51 // Called when the user updates the set of enabled data types to sync. |args| |
| 52 // is ignored. |
| 53 void OnPreferredDataTypesUpdated(const ListValue* args); |
| 54 |
| 50 scoped_ptr<OptionsManagedBannerHandler> banner_handler_; | 55 scoped_ptr<OptionsManagedBannerHandler> banner_handler_; |
| 51 | 56 |
| 52 DISALLOW_COPY_AND_ASSIGN(PersonalOptionsHandler); | 57 DISALLOW_COPY_AND_ASSIGN(PersonalOptionsHandler); |
| 53 }; | 58 }; |
| 54 | 59 |
| 55 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ | 60 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ |
| OLD | NEW |