| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync/one_click_signin_sync_starter.h" | 5 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); | 349 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); |
| 350 if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) { | 350 if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) { |
| 351 browser_ = EnsureBrowser(browser_, profile_, desktop_type_); | 351 browser_ = EnsureBrowser(browser_, profile_, desktop_type_); |
| 352 // Display a confirmation dialog to the user. | 352 // Display a confirmation dialog to the user. |
| 353 browser_->window()->ShowOneClickSigninBubble( | 353 browser_->window()->ShowOneClickSigninBubble( |
| 354 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG, | 354 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG, |
| 355 base::UTF8ToUTF16(signin->GetUsernameForAuthInProgress()), | 355 base::UTF8ToUTF16(signin->GetUsernameForAuthInProgress()), |
| 356 base::string16(), // No error message to display. | 356 base::string16(), // No error message to display. |
| 357 base::Bind(&OneClickSigninSyncStarter::UntrustedSigninConfirmed, | 357 base::Bind(&OneClickSigninSyncStarter::UntrustedSigninConfirmed, |
| 358 weak_pointer_factory_.GetWeakPtr())); | 358 weak_pointer_factory_.GetWeakPtr())); |
| 359 LoginUIServiceFactory::GetForProfile(profile_)->UntrustedLoginUIShown(); |
| 359 } else { | 360 } else { |
| 360 // No confirmation required - just sign in the user. | 361 // No confirmation required - just sign in the user. |
| 361 signin->CompletePendingSignin(); | 362 signin->CompletePendingSignin(); |
| 362 } | 363 } |
| 363 } | 364 } |
| 364 | 365 |
| 365 void OneClickSigninSyncStarter::UntrustedSigninConfirmed( | 366 void OneClickSigninSyncStarter::UntrustedSigninConfirmed( |
| 366 StartSyncMode response) { | 367 StartSyncMode response) { |
| 367 if (response == UNDO_SYNC) { | 368 if (response == UNDO_SYNC) { |
| 368 CancelSigninAndDelete(); // This statement frees this object. | 369 CancelSigninAndDelete(); // This statement frees this object. |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 false /* user_gesture */); | 598 false /* user_gesture */); |
| 598 } | 599 } |
| 599 | 600 |
| 600 void OneClickSigninSyncStarter::LoadContinueUrl() { | 601 void OneClickSigninSyncStarter::LoadContinueUrl() { |
| 601 web_contents()->GetController().LoadURL( | 602 web_contents()->GetController().LoadURL( |
| 602 continue_url_, | 603 continue_url_, |
| 603 content::Referrer(), | 604 content::Referrer(), |
| 604 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 605 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 605 std::string()); | 606 std::string()); |
| 606 } | 607 } |
| OLD | NEW |