| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 } // namespace | 234 } // namespace |
| 235 | 235 |
| 236 InlineLoginHandlerImpl::InlineLoginHandlerImpl() | 236 InlineLoginHandlerImpl::InlineLoginHandlerImpl() |
| 237 : confirm_untrusted_signin_(false), | 237 : confirm_untrusted_signin_(false), |
| 238 weak_factory_(this) { | 238 weak_factory_(this) { |
| 239 } | 239 } |
| 240 | 240 |
| 241 InlineLoginHandlerImpl::~InlineLoginHandlerImpl() {} | 241 InlineLoginHandlerImpl::~InlineLoginHandlerImpl() {} |
| 242 | 242 |
| 243 // This method is not called with webview sign in enabled. |
| 243 void InlineLoginHandlerImpl::DidCommitProvisionalLoadForFrame( | 244 void InlineLoginHandlerImpl::DidCommitProvisionalLoadForFrame( |
| 244 content::RenderFrameHost* render_frame_host, | 245 content::RenderFrameHost* render_frame_host, |
| 245 const GURL& url, | 246 const GURL& url, |
| 246 ui::PageTransition transition_type) { | 247 ui::PageTransition transition_type) { |
| 247 if (!web_contents()) | 248 if (!web_contents()) |
| 248 return; | 249 return; |
| 249 | 250 |
| 250 // Returns early if this is not a gaia iframe navigation. | 251 // Returns early if this is not a gaia iframe navigation. |
| 251 const GURL kGaiaExtOrigin( | 252 const GURL kGaiaExtOrigin( |
| 252 "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/"); | 253 "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/"); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 args->GetDictionary(0, &dict); | 288 args->GetDictionary(0, &dict); |
| 288 | 289 |
| 289 bool skip_for_now = false; | 290 bool skip_for_now = false; |
| 290 dict->GetBoolean("skipForNow", &skip_for_now); | 291 dict->GetBoolean("skipForNow", &skip_for_now); |
| 291 if (skip_for_now) { | 292 if (skip_for_now) { |
| 292 signin::SetUserSkippedPromo(Profile::FromWebUI(web_ui())); | 293 signin::SetUserSkippedPromo(Profile::FromWebUI(web_ui())); |
| 293 SyncStarterCallback(OneClickSigninSyncStarter::SYNC_SETUP_FAILURE); | 294 SyncStarterCallback(OneClickSigninSyncStarter::SYNC_SETUP_FAILURE); |
| 294 return; | 295 return; |
| 295 } | 296 } |
| 296 | 297 |
| 298 // This value exists only for webview sign in. |
| 299 bool trusted = false; |
| 300 if (dict->GetBoolean("trusted", &trusted)) |
| 301 confirm_untrusted_signin_ = !trusted; |
| 302 |
| 297 base::string16 email_string16; | 303 base::string16 email_string16; |
| 298 dict->GetString("email", &email_string16); | 304 dict->GetString("email", &email_string16); |
| 299 DCHECK(!email_string16.empty()); | 305 DCHECK(!email_string16.empty()); |
| 300 std::string email(base::UTF16ToASCII(email_string16)); | 306 std::string email(base::UTF16ToASCII(email_string16)); |
| 301 | 307 |
| 302 base::string16 password_string16; | 308 base::string16 password_string16; |
| 303 dict->GetString("password", &password_string16); | 309 dict->GetString("password", &password_string16); |
| 304 std::string password(base::UTF16ToASCII(password_string16)); | 310 std::string password(base::UTF16ToASCII(password_string16)); |
| 305 | 311 |
| 306 base::string16 gaia_id_string16; | 312 base::string16 gaia_id_string16; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 } | 457 } |
| 452 } | 458 } |
| 453 | 459 |
| 454 if (show_account_management) { | 460 if (show_account_management) { |
| 455 browser->window()->ShowAvatarBubbleFromAvatarButton( | 461 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 456 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, | 462 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, |
| 457 signin::ManageAccountsParams()); | 463 signin::ManageAccountsParams()); |
| 458 } | 464 } |
| 459 } | 465 } |
| 460 } | 466 } |
| OLD | NEW |