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

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

Issue 10806048: Change the navigation code of sync promo slightly to navigate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
===================================================================
--- chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc (revision 147566)
+++ chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc (working copy)
@@ -43,6 +43,7 @@
const char kSyncPromoQueryKeyNextPage[] = "next_page";
const char kSyncPromoQueryKeySource[] = "source";
+const char kSyncPromoQueryKeyAutoClose[] = "auto_close";
// The maximum number of times we want to show the sync promo at startup.
const int kSyncPromoShowAtStartupMaximum = 10;
@@ -205,13 +206,18 @@
}
// static
-GURL SyncPromoUI::GetSyncPromoURL(const GURL& next_page, Source source) {
+GURL SyncPromoUI::GetSyncPromoURL(const GURL& next_page,
+ Source source,
+ bool auto_close) {
DCHECK_NE(SOURCE_UNKNOWN, source);
std::stringstream stream;
stream << chrome::kChromeUISyncPromoURL << "?"
<< kSyncPromoQueryKeySource << "=" << static_cast<int>(source);
+ if (auto_close)
+ stream << "&" << kSyncPromoQueryKeyAutoClose << "=1";
+
if (!next_page.spec().empty()) {
url_canon::RawCanonOutputT<char> output;
url_util::EncodeURIComponent(
@@ -246,3 +252,15 @@
}
return SOURCE_UNKNOWN;
}
+
+// static
+bool SyncPromoUI::GetAutoCloseForSyncPromoURL(const GURL& url) {
+ std::string value;
+ if (chrome_common_net::GetValueForKeyInQuery(
+ url, kSyncPromoQueryKeyAutoClose, &value)) {
+ int source = 0;
+ base::StringToInt(value, &source);
+ return (source == 1);
+ }
+ return false;
+}
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698