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

Unified Diff: chrome/browser/ui/webui/signin/inline_login_handler_impl.cc

Issue 1365813003: Make sure links in the profile unlock reauth don't break out of popup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 5 years, 3 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/resources/gaia_auth_host/authenticator.js ('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/signin/inline_login_handler_impl.cc
diff --git a/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc b/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc
index 7d53c8db25f5695a05bffeba3d5433d6d9889551..5a7b0bb9a37117daae477daa361fc1c1aba28d79 100644
--- a/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc
+++ b/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc
@@ -69,6 +69,11 @@ void LogHistogramValue(int action) {
signin_metrics::HISTOGRAM_MAX);
}
+// Returns true if |profile| is a system profile or created from one.
+bool IsSystemProfile(Profile* profile) {
+ return profile->GetOriginalProfile()->IsSystemProfile();
+}
+
void RedirectToNtpOrAppsPage(content::WebContents* contents,
signin_metrics::Source source) {
// Do nothing if a navigation is pending, since this call can be triggered
@@ -599,6 +604,12 @@ bool InlineLoginHandlerImpl::CanOffer(Profile* profile,
void InlineLoginHandlerImpl::SetExtraInitParams(base::DictionaryValue& params) {
params.SetString("service", "chromiumsync");
+ // If this was called from the user manager to reauthenticate the profile,
+ // make sure the webui is aware.
+ Profile* profile = Profile::FromWebUI(web_ui());
+ if (IsSystemProfile(profile))
+ params.SetBoolean("dontResizeNonEmbeddedPages", true);
+
content::WebContents* contents = web_ui()->GetWebContents();
content::WebContentsObserver::Observe(contents);
LogHistogramValue(signin_metrics::HISTOGRAM_SHOWN);
@@ -655,7 +666,7 @@ void InlineLoginHandlerImpl::CompleteLogin(const base::ListValue* args) {
// find the right profile to reauthenticate. Otherwise the profile can be
// taken from web_ui().
Profile* profile = Profile::FromWebUI(web_ui());
- if (profile->GetOriginalProfile()->IsSystemProfile()) {
+ if (IsSystemProfile(profile)) {
// Switch to the profile and finish the login. Don't pass a handler pointer
// since it will be destroyed before the callback runs.
ProfileManager* manager = g_browser_process->profile_manager();
« no previous file with comments | « chrome/browser/resources/gaia_auth_host/authenticator.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698