Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2879)

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_sync_setup_handler.h

Issue 7399015: Sync Promo: Add a way to collapse the sync promo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review feedback Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/ntp/new_tab_sync_setup_handler.h
diff --git a/chrome/browser/ui/webui/ntp/new_tab_sync_setup_handler.h b/chrome/browser/ui/webui/ntp/new_tab_sync_setup_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..db0d501871a8080d5d02af6a0c510808b0cbc69e
--- /dev/null
+++ b/chrome/browser/ui/webui/ntp/new_tab_sync_setup_handler.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#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:
+ void UpdateLogin();
James Hawkins 2011/07/20 01:55:26 Document method.
sail 2011/07/20 19:40:25 Done.
+
+ // Preference for the sync login name.
+ StringPrefMember username_pref_;
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_SYNC_SETUP_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698