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

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: added comments Created 6 years, 5 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/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 10
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); 318 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_);
319 if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) { 319 if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) {
320 browser_ = EnsureBrowser(browser_, profile_, desktop_type_); 320 browser_ = EnsureBrowser(browser_, profile_, desktop_type_);
321 // Display a confirmation dialog to the user. 321 // Display a confirmation dialog to the user.
322 browser_->window()->ShowOneClickSigninBubble( 322 browser_->window()->ShowOneClickSigninBubble(
323 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG, 323 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG,
324 base::UTF8ToUTF16(signin->GetUsernameForAuthInProgress()), 324 base::UTF8ToUTF16(signin->GetUsernameForAuthInProgress()),
325 base::string16(), // No error message to display. 325 base::string16(), // No error message to display.
326 base::Bind(&OneClickSigninSyncStarter::UntrustedSigninConfirmed, 326 base::Bind(&OneClickSigninSyncStarter::UntrustedSigninConfirmed,
327 weak_pointer_factory_.GetWeakPtr())); 327 weak_pointer_factory_.GetWeakPtr()));
328 LoginUIServiceFactory::GetForProfile(profile_)->UntrustedSigninUIShown();
328 } else { 329 } else {
329 // No confirmation required - just sign in the user. 330 // No confirmation required - just sign in the user.
330 signin->CompletePendingSignin(); 331 signin->CompletePendingSignin();
331 } 332 }
332 } 333 }
333 334
334 void OneClickSigninSyncStarter::UntrustedSigninConfirmed( 335 void OneClickSigninSyncStarter::UntrustedSigninConfirmed(
335 StartSyncMode response) { 336 StartSyncMode response) {
336 if (response == UNDO_SYNC) { 337 if (response == UNDO_SYNC) {
337 CancelSigninAndDelete(); // This statement frees this object. 338 CancelSigninAndDelete(); // This statement frees this object.
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 false /* user_gesture */); 550 false /* user_gesture */);
550 } 551 }
551 552
552 void OneClickSigninSyncStarter::LoadContinueUrl() { 553 void OneClickSigninSyncStarter::LoadContinueUrl() {
553 web_contents()->GetController().LoadURL( 554 web_contents()->GetController().LoadURL(
554 continue_url_, 555 continue_url_,
555 content::Referrer(), 556 content::Referrer(),
556 content::PAGE_TRANSITION_AUTO_TOPLEVEL, 557 content::PAGE_TRANSITION_AUTO_TOPLEVEL,
557 std::string()); 558 std::string());
558 } 559 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698