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

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

Issue 1984863002: Clean up LoginUIService. Remove Singleton behavior from PeopleHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge issue Created 4 years, 6 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); 351 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_);
352 if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) { 352 if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) {
353 browser_ = EnsureBrowser(browser_, profile_); 353 browser_ = EnsureBrowser(browser_, profile_);
354 content::RecordAction( 354 content::RecordAction(
355 base::UserMetricsAction("Signin_Show_UntrustedSigninPrompt")); 355 base::UserMetricsAction("Signin_Show_UntrustedSigninPrompt"));
356 // Display a confirmation dialog to the user. 356 // Display a confirmation dialog to the user.
357 browser_->window()->ShowOneClickSigninConfirmation( 357 browser_->window()->ShowOneClickSigninConfirmation(
358 base::UTF8ToUTF16(signin->GetUsernameForAuthInProgress()), 358 base::UTF8ToUTF16(signin->GetUsernameForAuthInProgress()),
359 base::Bind(&OneClickSigninSyncStarter::UntrustedSigninConfirmed, 359 base::Bind(&OneClickSigninSyncStarter::UntrustedSigninConfirmed,
360 weak_pointer_factory_.GetWeakPtr())); 360 weak_pointer_factory_.GetWeakPtr()));
361 LoginUIServiceFactory::GetForProfile(profile_)->UntrustedLoginUIShown();
362 } else { 361 } else {
363 // No confirmation required - just sign in the user. 362 // No confirmation required - just sign in the user.
364 signin->CompletePendingSignin(); 363 signin->CompletePendingSignin();
365 } 364 }
366 } 365 }
367 366
368 void OneClickSigninSyncStarter::UntrustedSigninConfirmed( 367 void OneClickSigninSyncStarter::UntrustedSigninConfirmed(
369 StartSyncMode response) { 368 StartSyncMode response) {
370 if (response == UNDO_SYNC) { 369 if (response == UNDO_SYNC) {
371 content::RecordAction(base::UserMetricsAction("Signin_Undo_Signin")); 370 content::RecordAction(base::UserMetricsAction("Signin_Undo_Signin"));
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 false /* user_gesture */); 642 false /* user_gesture */);
644 } 643 }
645 644
646 void OneClickSigninSyncStarter::LoadContinueUrl() { 645 void OneClickSigninSyncStarter::LoadContinueUrl() {
647 web_contents()->GetController().LoadURL( 646 web_contents()->GetController().LoadURL(
648 continue_url_, 647 continue_url_,
649 content::Referrer(), 648 content::Referrer(),
650 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, 649 ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
651 std::string()); 650 std::string());
652 } 651 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_global_error_unittest.cc ('k') | chrome/browser/ui/webui/options/sync_setup_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698