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

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

Issue 12088040: Add a SigninAllowed policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Extract managed user specific stuff into another changelist. Created 7 years, 10 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_page_sync_handler.h
diff --git a/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h b/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h
index 9ac909283d3cbce671210e3b71cd6af9b6520d8c..cf067fe757762250f4ac4e00eefece09245855d5 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h
+++ b/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/prefs/public/pref_change_registrar.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/sync_ui_util.h"
#include "content/public/browser/web_ui_message_handler.h"
@@ -34,14 +35,17 @@ class NewTabPageSyncHandler : public content::WebUIMessageHandler,
// ProfileSyncServiceObserver
virtual void OnStateChanged() OVERRIDE;
+ void OnSigninAllowedPrefChange();
+
private:
+ friend class NewTabPageSyncHandlerTest;
enum MessageType {
HIDE,
SYNC_ERROR,
SYNC_PROMO
};
// Helper to invoke the |syncMessageChanged| JS function on the new tab page.
- void SendSyncMessageToPage(MessageType type,
+ virtual void SendSyncMessageToPage(MessageType type,
std::string msg, std::string linktext);
sail 2013/02/08 20:18:57 indentation is incorrect
Adrian Kuegel 2013/02/11 16:47:30 Yes, sorry about that, I forgot to fix it when I a
// Helper to query the sync service and figure out what to send to
@@ -59,6 +63,8 @@ class NewTabPageSyncHandler : public content::WebUIMessageHandler,
// Cached pointer to ProfileSyncService.
ProfileSyncService* sync_service_;
+ PrefChangeRegistrar profile_pref_registrar_;
+
// Used to make sure we don't register ourselves twice if the user refreshes
// the new tab page.
bool waiting_for_initial_page_load_;

Powered by Google App Engine
This is Rietveld 408576698