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

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

Issue 7481023: Adding notifications for new sync types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now acknowledges sync types when notification is clocked. 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_page_sync_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc b/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc
index 0cf46ff67e6d571947bd72f0d7ba97033df431e7..574230e72dbb179d01111b4ffe8c32a3b47402b6 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc
@@ -110,6 +110,8 @@ void NewTabPageSyncHandler::RegisterMessages() {
NewCallback(this, &NewTabPageSyncHandler::HandleGetSyncMessage));
web_ui_->RegisterMessageCallback("SyncLinkClicked",
NewCallback(this, &NewTabPageSyncHandler::HandleSyncLinkClicked));
+ web_ui_->RegisterMessageCallback("SyncTypeLinkClicked",
+ NewCallback(this, &NewTabPageSyncHandler::HandleSyncTypeLinkClicked));
}
void NewTabPageSyncHandler::HandleGetSyncMessage(const ListValue* args) {
@@ -170,6 +172,15 @@ void NewTabPageSyncHandler::HandleSyncLinkClicked(const ListValue* args) {
}
}
+void NewTabPageSyncHandler::HandleSyncTypeLinkClicked(const ListValue* args) {
+ if (sync_service_->HasSyncSetupCompleted()) {
+ sync_service_->AcknowledgeSyncedTypes();
+ sync_service_->ShowConfigure(false);
+ } else {
+ sync_service_->ShowLoginDialog();
+ }
+}
+
void NewTabPageSyncHandler::OnStateChanged() {
// Don't do anything if the page has not yet loaded.
if (waiting_for_initial_page_load_)

Powered by Google App Engine
This is Rietveld 408576698