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

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_sync_starter.cc

Issue 418043002: Add test for showing confirmation dialog for unsecure signin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybot errors fixed Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); 375 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_);
376 if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) { 376 if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) {
377 browser_ = EnsureBrowser(browser_, profile_, desktop_type_); 377 browser_ = EnsureBrowser(browser_, profile_, desktop_type_);
378 // Display a confirmation dialog to the user. 378 // Display a confirmation dialog to the user.
379 browser_->window()->ShowOneClickSigninBubble( 379 browser_->window()->ShowOneClickSigninBubble(
380 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG, 380 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG,
381 base::UTF8ToUTF16(signin->GetUsernameForAuthInProgress()), 381 base::UTF8ToUTF16(signin->GetUsernameForAuthInProgress()),
382 base::string16(), // No error message to display. 382 base::string16(), // No error message to display.
383 base::Bind(&OneClickSigninSyncStarter::UntrustedSigninConfirmed, 383 base::Bind(&OneClickSigninSyncStarter::UntrustedSigninConfirmed,
384 weak_pointer_factory_.GetWeakPtr())); 384 weak_pointer_factory_.GetWeakPtr()));
385 LoginUIServiceFactory::GetForProfile(profile_)->UntrustedLoginUIShown();
385 } else { 386 } else {
386 // No confirmation required - just sign in the user. 387 // No confirmation required - just sign in the user.
387 signin->CompletePendingSignin(); 388 signin->CompletePendingSignin();
388 } 389 }
389 } 390 }
390 391
391 void OneClickSigninSyncStarter::UntrustedSigninConfirmed( 392 void OneClickSigninSyncStarter::UntrustedSigninConfirmed(
392 StartSyncMode response) { 393 StartSyncMode response) {
393 if (response == UNDO_SYNC) { 394 if (response == UNDO_SYNC) {
394 CancelSigninAndDelete(); // This statement frees this object. 395 CancelSigninAndDelete(); // This statement frees this object.
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 false /* user_gesture */); 633 false /* user_gesture */);
633 } 634 }
634 635
635 void OneClickSigninSyncStarter::LoadContinueUrl() { 636 void OneClickSigninSyncStarter::LoadContinueUrl() {
636 web_contents()->GetController().LoadURL( 637 web_contents()->GetController().LoadURL(
637 continue_url_, 638 continue_url_,
638 content::Referrer(), 639 content::Referrer(),
639 content::PAGE_TRANSITION_AUTO_TOPLEVEL, 640 content::PAGE_TRANSITION_AUTO_TOPLEVEL,
640 std::string()); 641 std::string());
641 } 642 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698