summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-21 21:48:53 +0000
committermirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-21 21:48:53 +0000
commitf6581dc9409b19c44c105cff555a79827f2ee9f4 (patch)
tree52c6a43498e306a7248100100b98238f526e8639 /chrome
parent17ba1120adc5deae49bf6100f430498501b0c3a8 (diff)
downloadchromium_src-f6581dc9409b19c44c105cff555a79827f2ee9f4.zip
chromium_src-f6581dc9409b19c44c105cff555a79827f2ee9f4.tar.gz
chromium_src-f6581dc9409b19c44c105cff555a79827f2ee9f4.tar.bz2
Revert 32754 - Remove old bookmark sync promo from new tab page.
BUG= 28050, 27338 TEST= old bookmark sync promo should no longer appear on NTP. Review URL: http://codereview.chromium.org/420004 TBR=mirandac@chromium.org Review URL: http://codereview.chromium.org/414075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32756 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/generated_resources.grd6
-rw-r--r--chrome/browser/dom_ui/new_tab_page_sync_handler.cc10
-rw-r--r--chrome/browser/dom_ui/new_tab_page_sync_handler.h1
3 files changed, 16 insertions, 1 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 2efa902..f7e0da7 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5604,6 +5604,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_SYNC_NTP_SYNC_SECTION_ERROR_TITLE" desc="The title to display in the New Tab Page sync status section in case of an error.">
Bookmark Sync Error!
</message>
+ <message name="IDS_SYNC_NTP_PROMOTION_MESSAGE" desc="The New Tab Page sync promotion message to display in the sync status section.">
+ You can sync your bookmarks across computers using your Google account
+ </message>
+ <message name="IDS_SYNC_NTP_START_NOW_LINK_LABEL" desc="The label to display for the New Tab Page promotion link.">
+ Start now
+ </message>
<message name="IDS_SYNC_NTP_SETUP_IN_PROGRESS" desc="The message to display in the New Tab Page sync section when the sync setup is underway.">
Setup in progress...
</message>
diff --git a/chrome/browser/dom_ui/new_tab_page_sync_handler.cc b/chrome/browser/dom_ui/new_tab_page_sync_handler.cc
index 466931a..6773756 100644
--- a/chrome/browser/dom_ui/new_tab_page_sync_handler.cc
+++ b/chrome/browser/dom_ui/new_tab_page_sync_handler.cc
@@ -125,8 +125,15 @@ void NewTabPageSyncHandler::BuildAndSendSyncStatus() {
return;
}
- // Don't show sync status if setup is not complete.
+ // We show the sync promotion if sync has not been enabled and the user is
+ // logged in to Google Accounts. If the user is not signed in to GA, we
+ // should hide the sync status section entirely.
if (!sync_service_->HasSyncSetupCompleted()) {
+ if (!sync_service_->SetupInProgress() && IsGoogleGAIACookieInstalled()) {
+ SendSyncMessageToPage(PROMOTION,
+ WideToUTF8(l10n_util::GetString(IDS_SYNC_NTP_PROMOTION_MESSAGE)),
+ WideToUTF8(l10n_util::GetString(IDS_SYNC_NTP_START_NOW_LINK_LABEL)));
+ }
return;
}
@@ -175,6 +182,7 @@ void NewTabPageSyncHandler::SendSyncMessageToPage(
std::string linkurl;
switch (type) {
case HIDE:
+ case PROMOTION:
msgtype = "presynced";
break;
case SYNC_ERROR:
diff --git a/chrome/browser/dom_ui/new_tab_page_sync_handler.h b/chrome/browser/dom_ui/new_tab_page_sync_handler.h
index 67b565c..cde61da 100644
--- a/chrome/browser/dom_ui/new_tab_page_sync_handler.h
+++ b/chrome/browser/dom_ui/new_tab_page_sync_handler.h
@@ -36,6 +36,7 @@ class NewTabPageSyncHandler : public DOMMessageHandler,
private:
enum MessageType {
HIDE,
+ PROMOTION,
SYNC_ERROR,
};
// Helper to invoke the |syncMessageChanged| JS function on the new tab page.