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

Unified Diff: chrome/browser/ui/webui/sync_promo_ui.cc

Issue 8689006: Create a field test for sync sign in promo strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: small typo spotted by tmccoy Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/webui/sync_promo_ui.h ('k') | chrome/browser/ui/webui/sync_setup_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/sync_promo_ui.cc
===================================================================
--- chrome/browser/ui/webui/sync_promo_ui.cc (revision 111699)
+++ chrome/browser/ui/webui/sync_promo_ui.cc (working copy)
@@ -32,7 +32,7 @@
const char kStringsJsFile[] = "strings.js";
const char kSyncPromoJsFile[] = "sync_promo.js";
-const char kSyncPromoQueryKeyShowTitle[] = "show_title";
+const char kSyncPromoQueryKeyIsLaunchPage[] = "is_launch_page";
const char kSyncPromoQueryKeyNextPage[] = "next_page";
// The maximum number of times we want to show the sync promo at startup.
@@ -62,18 +62,18 @@
// The Web UI data source for the sync promo page.
class SyncPromoUIHTMLSource : public ChromeWebUIDataSource {
public:
- SyncPromoUIHTMLSource();
+ explicit SyncPromoUIHTMLSource(WebUI* web_ui);
private:
~SyncPromoUIHTMLSource() {}
DISALLOW_COPY_AND_ASSIGN(SyncPromoUIHTMLSource);
};
-SyncPromoUIHTMLSource::SyncPromoUIHTMLSource()
+SyncPromoUIHTMLSource::SyncPromoUIHTMLSource(WebUI* web_ui)
: ChromeWebUIDataSource(chrome::kChromeUISyncPromoHost) {
DictionaryValue localized_strings;
CoreOptionsHandler::GetStaticLocalizedValues(&localized_strings);
- SyncSetupHandler::GetStaticLocalizedValues(&localized_strings);
+ SyncSetupHandler::GetStaticLocalizedValues(&localized_strings, web_ui);
AddLocalizedStrings(localized_strings);
}
@@ -116,7 +116,7 @@
profile->GetChromeURLDataManager()->AddDataSource(theme);
// Set up the sync promo source.
- SyncPromoUIHTMLSource* html_source = new SyncPromoUIHTMLSource();
+ SyncPromoUIHTMLSource* html_source = new SyncPromoUIHTMLSource(this);
html_source->set_json_path(kStringsJsFile);
html_source->add_resource_path(kSyncPromoJsFile, IDR_SYNC_PROMO_JS);
html_source->set_default_resource(IDR_SYNC_PROMO_HTML);
@@ -214,8 +214,9 @@
// static
GURL SyncPromoUI::GetSyncPromoURL(const GURL& next_page, bool show_title) {
std::stringstream stream;
- stream << chrome::kChromeUISyncPromoURL << "?" << kSyncPromoQueryKeyShowTitle
- << "=" << (show_title ? "true" : "false");
+ stream << chrome::kChromeUISyncPromoURL << "?"
+ << kSyncPromoQueryKeyIsLaunchPage << "="
+ << (show_title ? "true" : "false");
if (!next_page.spec().empty()) {
url_canon::RawCanonOutputT<char> output;
@@ -229,9 +230,11 @@
}
// static
-bool SyncPromoUI::GetShowTitleForSyncPromoURL(const GURL& url) {
+bool SyncPromoUI::GetIsLaunchPageForSyncPromoURL(const GURL& url) {
std::string value;
- if (GetValueForKeyInQuery(url, kSyncPromoQueryKeyShowTitle, &value))
+ // Show the title if the promo is currently the Chrome launch page (and not
+ // the page accessed through the NTP).
+ if (GetValueForKeyInQuery(url, kSyncPromoQueryKeyIsLaunchPage, &value))
return value == "true";
return false;
}
« no previous file with comments | « chrome/browser/ui/webui/sync_promo_ui.h ('k') | chrome/browser/ui/webui/sync_setup_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698