| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // Returns early if this is not a gaia iframe navigation. | 237 // Returns early if this is not a gaia iframe navigation. |
| 238 const GURL kGaiaExtOrigin( | 238 const GURL kGaiaExtOrigin( |
| 239 "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/"); | 239 "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/"); |
| 240 content::RenderFrameHost* gaia_iframe = InlineLoginUI::GetAuthIframe( | 240 content::RenderFrameHost* gaia_iframe = InlineLoginUI::GetAuthIframe( |
| 241 web_contents(), kGaiaExtOrigin, "signin-frame"); | 241 web_contents(), kGaiaExtOrigin, "signin-frame"); |
| 242 if (render_frame_host != gaia_iframe) | 242 if (render_frame_host != gaia_iframe) |
| 243 return; | 243 return; |
| 244 | 244 |
| 245 // Loading any untrusted (e.g., HTTP) URLs in the privileged sign-in process | 245 // Loading any untrusted (e.g., HTTP) URLs in the privileged sign-in process |
| 246 // will require confirmation before the sign in takes effect. | 246 // will require confirmation before the sign in takes effect. |
| 247 if (!url.is_empty() && | 247 if (!url.is_empty()) { |
| 248 url.spec() != url::kAboutBlankURL && | 248 GURL origin(url.GetOrigin()); |
| 249 !gaia::IsGaiaSignonRealm(url.GetOrigin()) && | 249 if (url.spec() != url::kAboutBlankURL && |
| 250 !signin::IsContinueUrlForWebBasedSigninFlow(url)) { | 250 origin != kGaiaExtOrigin && |
| 251 confirm_untrusted_signin_ = true; | 251 !gaia::IsGaiaSignonRealm(origin)) { |
| 252 confirm_untrusted_signin_ = true; |
| 253 } |
| 252 } | 254 } |
| 253 } | 255 } |
| 254 | 256 |
| 255 void InlineLoginHandlerImpl::SetExtraInitParams(base::DictionaryValue& params) { | 257 void InlineLoginHandlerImpl::SetExtraInitParams(base::DictionaryValue& params) { |
| 256 params.SetString("service", "chromiumsync"); | 258 params.SetString("service", "chromiumsync"); |
| 257 | 259 |
| 258 content::WebContents* contents = web_ui()->GetWebContents(); | 260 content::WebContents* contents = web_ui()->GetWebContents(); |
| 259 const GURL& current_url = contents->GetURL(); | 261 const GURL& current_url = contents->GetURL(); |
| 260 std::string is_constrained; | 262 std::string is_constrained; |
| 261 net::GetValueForKeyInQuery(current_url, "constrained", &is_constrained); | 263 net::GetValueForKeyInQuery(current_url, "constrained", &is_constrained); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 } | 442 } |
| 441 } | 443 } |
| 442 | 444 |
| 443 if (show_account_management) { | 445 if (show_account_management) { |
| 444 browser->window()->ShowAvatarBubbleFromAvatarButton( | 446 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 445 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, | 447 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, |
| 446 signin::ManageAccountsParams()); | 448 signin::ManageAccountsParams()); |
| 447 } | 449 } |
| 448 } | 450 } |
| 449 } | 451 } |
| OLD | NEW |