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

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: sync and add datatype push update notifications Created 4 years, 7 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 false /* user_gesture */); 645 false /* user_gesture */);
647 } 646 }
648 647
649 void OneClickSigninSyncStarter::LoadContinueUrl() { 648 void OneClickSigninSyncStarter::LoadContinueUrl() {
650 web_contents()->GetController().LoadURL( 649 web_contents()->GetController().LoadURL(
651 continue_url_, 650 continue_url_,
652 content::Referrer(), 651 content::Referrer(),
653 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, 652 ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
654 std::string()); 653 std::string());
655 } 654 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698