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

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

Issue 12374007: signin: force web signin flow initiated visits to accounts.google.com to their own process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: charlie's review 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/sync_promo/sync_promo_ui.cc
diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
index 4c0920d235cedc0c7b9665202be3ad1614aaa0b5..880bb8752090f6ce6e08e5671c8e6bbae6db89f0 100644
--- a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
+++ b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
@@ -96,6 +96,11 @@ content::WebUIDataSource* CreateSyncUIHTMLSource(content::WebUI* web_ui) {
} // namespace
+// Under the covers, we use a dummy chrome-extension ID to serve the purposes
+// outlined in the .h file comment for this string.
+const char* SyncPromoUI::kChromeSigninEffectiveOrigin =
+ "chrome-extension://acfccoigjajmmgbhpfbjnpckhjjegnih";
Charlie Reis 2013/03/06 01:28:46 Separate from this CL, please ask erikkay@ how we
+
SyncPromoUI::SyncPromoUI(content::WebUI* web_ui) : WebUIController(web_ui) {
SyncPromoHandler* handler = new SyncPromoHandler(
g_browser_process->profile_manager());
@@ -259,6 +264,20 @@ GURL SyncPromoUI::GetSyncPromoURL(const GURL& next_page,
}
// static
+bool SyncPromoUI::IsWebBasedSigninFlowURL(const GURL& url) {
+ GURL effective(kChromeSigninEffectiveOrigin);
+ if (url.SchemeIs(effective.scheme().c_str()) &&
+ url.host() == effective.host())
+ return true;
+
+ GURL service_login(GaiaUrls::GetInstance()->service_login_url());
+ if (url.GetOrigin() != service_login.GetOrigin())
+ return false;
+
+ return url.path() == service_login.path();
+}
+
+// static
GURL SyncPromoUI::GetNextPageURLForSyncPromoURL(const GURL& url) {
const char* key_name = UseWebBasedSigninFlow() ? kSyncPromoQueryKeyContinue :
kSyncPromoQueryKeyNextPage;

Powered by Google App Engine
This is Rietveld 408576698