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

Unified Diff: chrome/browser/ui/sync/one_click_signin_sync_starter.cc

Issue 1511023002: Do not reuse webcontent which associates constrained login page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/one_click_signin_sync_starter.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
index 6a0c0e148c5117f657de924736e6313d549e7a7c..e25a56bd075e83bfe07faf61d03c5aa912c0ea56 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -40,6 +40,7 @@
#include "components/signin/core/browser/signin_manager.h"
#include "components/signin/core/browser/signin_metrics.h"
#include "components/sync_driver/sync_prefs.h"
+#include "net/base/url_util.h"
#include "net/url_request/url_request_context_getter.h"
#include "ui/base/l10n/l10n_util.h"
@@ -534,15 +535,17 @@ void OneClickSigninSyncStarter::ShowSettingsPage(bool configure_sync) {
bool use_same_tab = false;
if (web_contents()) {
GURL current_url = web_contents()->GetLastCommittedURL();
+ std::string constrained_key;
+ net::GetValueForKeyInQuery(current_url, "constrained", &constrained_key);
+ bool is_constrained = (constrained_key == "1");
bool is_chrome_signin_url =
current_url.GetOrigin().spec() == chrome::kChromeUIChromeSigninURL;
bool is_same_profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext()) ==
profile_;
- use_same_tab =
- is_chrome_signin_url &&
- !signin::IsAutoCloseEnabledInURL(current_url) &&
- is_same_profile;
+ use_same_tab = !is_constrained && is_chrome_signin_url &&
+ !signin::IsAutoCloseEnabledInURL(current_url) &&
+ is_same_profile;
}
if (profile_sync_service) {
// Need to navigate to the settings page and display the sync UI.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698