| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); | 356 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); |
| 357 if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) { | 357 if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) { |
| 358 browser_ = EnsureBrowser(browser_, profile_, desktop_type_); | 358 browser_ = EnsureBrowser(browser_, profile_, desktop_type_); |
| 359 // Display a confirmation dialog to the user. | 359 // Display a confirmation dialog to the user. |
| 360 browser_->window()->ShowOneClickSigninBubble( | 360 browser_->window()->ShowOneClickSigninBubble( |
| 361 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG, | 361 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG, |
| 362 base::UTF8ToUTF16(signin->GetUsernameForAuthInProgress()), | 362 base::UTF8ToUTF16(signin->GetUsernameForAuthInProgress()), |
| 363 base::string16(), // No error message to display. | 363 base::string16(), // No error message to display. |
| 364 base::Bind(&OneClickSigninSyncStarter::UntrustedSigninConfirmed, | 364 base::Bind(&OneClickSigninSyncStarter::UntrustedSigninConfirmed, |
| 365 weak_pointer_factory_.GetWeakPtr())); | 365 weak_pointer_factory_.GetWeakPtr())); |
| 366 LoginUIServiceFactory::GetForProfile(profile_)->UntrustedLoginUIShown(); |
| 366 } else { | 367 } else { |
| 367 // No confirmation required - just sign in the user. | 368 // No confirmation required - just sign in the user. |
| 368 signin->CompletePendingSignin(); | 369 signin->CompletePendingSignin(); |
| 369 } | 370 } |
| 370 } | 371 } |
| 371 | 372 |
| 372 void OneClickSigninSyncStarter::UntrustedSigninConfirmed( | 373 void OneClickSigninSyncStarter::UntrustedSigninConfirmed( |
| 373 StartSyncMode response) { | 374 StartSyncMode response) { |
| 374 if (response == UNDO_SYNC) { | 375 if (response == UNDO_SYNC) { |
| 375 CancelSigninAndDelete(); // This statement frees this object. | 376 CancelSigninAndDelete(); // This statement frees this object. |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 false /* user_gesture */); | 611 false /* user_gesture */); |
| 611 } | 612 } |
| 612 | 613 |
| 613 void OneClickSigninSyncStarter::LoadContinueUrl() { | 614 void OneClickSigninSyncStarter::LoadContinueUrl() { |
| 614 web_contents()->GetController().LoadURL( | 615 web_contents()->GetController().LoadURL( |
| 615 continue_url_, | 616 continue_url_, |
| 616 content::Referrer(), | 617 content::Referrer(), |
| 617 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 618 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 618 std::string()); | 619 std::string()); |
| 619 } | 620 } |
| OLD | NEW |