Index: chrome/browser/ui/webui/ntp/new_tab_sync_setup_handler.h |
=================================================================== |
--- chrome/browser/ui/webui/ntp/new_tab_sync_setup_handler.h (revision 93571) |
+++ chrome/browser/ui/webui/ntp/new_tab_sync_setup_handler.h (working copy) |
@@ -5,13 +5,43 @@ |
#ifndef CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_SYNC_SETUP_HANDLER_H_ |
#define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_SYNC_SETUP_HANDLER_H_ |
+#include "chrome/browser/prefs/pref_member.h" |
#include "chrome/browser/ui/webui/sync_setup_handler.h" |
// The handler for Javascript messages related to the sync setup UI in the new |
// tab page. |
class NewTabSyncSetupHandler : public SyncSetupHandler { |
+ public: |
+ // Checks if the sync promo should be visible. |
+ static bool ShouldShowSyncPromo(); |
+ |
+ // WebUIMessageHandler implementation. |
+ virtual WebUIMessageHandler* Attach(WebUI* web_ui); |
+ virtual void RegisterMessages(); |
+ |
+ // NotificationObserver implementation. |
+ virtual void Observe(int type, |
+ const NotificationSource& source, |
+ const NotificationDetails& details); |
+ |
protected: |
virtual void ShowSetupUI(); |
+ |
+ // Javascript callback handler to initialize the sync promo UI. |
+ void HandleInitializeSyncPromo(const ListValue* args); |
+ |
+ // Javascript callback handler to collapse the sync promo. |
+ void HandleCollapseSyncPromo(const ListValue* args); |
+ |
+ // Javascript callback handler to expand the sync promo. |
+ void HandleExpandSyncPromo(const ListValue* args); |
+ |
+ private: |
+ // Sends the sync login name to the page. |
+ void UpdateLogin(); |
+ |
+ // Preference for the sync login name. |
+ StringPrefMember username_pref_; |
}; |
#endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_SYNC_SETUP_HANDLER_H_ |