| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 browser_ = EnsureBrowser(browser_, profile_); | 236 browser_ = EnsureBrowser(browser_, profile_); |
| 237 content::WebContents* web_contents = | 237 content::WebContents* web_contents = |
| 238 browser_->tab_strip_model()->GetActiveWebContents(); | 238 browser_->tab_strip_model()->GetActiveWebContents(); |
| 239 if (!web_contents) { | 239 if (!web_contents) { |
| 240 CancelSigninAndDelete(); | 240 CancelSigninAndDelete(); |
| 241 return; | 241 return; |
| 242 } | 242 } |
| 243 | 243 |
| 244 content::RecordAction( | 244 content::RecordAction( |
| 245 base::UserMetricsAction("Signin_Show_EnterpriseAccountPrompt")); | 245 base::UserMetricsAction("Signin_Show_EnterpriseAccountPrompt")); |
| 246 TabDialogs::FromWebContents(web_contents) | 246 TabDialogs::FromWebContents(web_contents)->ShowProfileSigninConfirmation( |
| 247 ->ShowProfileSigninConfirmation(browser_, profile_, | 247 browser_, |
| 248 signin->GetUsernameForAuthInProgress(), | 248 profile_, |
| 249 base::MakeUnique<SigninDialogDelegate>( | 249 signin->GetUsernameForAuthInProgress(), |
| 250 weak_pointer_factory_.GetWeakPtr())); | 250 new SigninDialogDelegate(weak_pointer_factory_.GetWeakPtr())); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void OneClickSigninSyncStarter::LoadPolicyWithCachedCredentials() { | 253 void OneClickSigninSyncStarter::LoadPolicyWithCachedCredentials() { |
| 254 DCHECK(!dm_token_.empty()); | 254 DCHECK(!dm_token_.empty()); |
| 255 DCHECK(!client_id_.empty()); | 255 DCHECK(!client_id_.empty()); |
| 256 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); | 256 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); |
| 257 policy::UserPolicySigninService* policy_service = | 257 policy::UserPolicySigninService* policy_service = |
| 258 policy::UserPolicySigninServiceFactory::GetForProfile(profile_); | 258 policy::UserPolicySigninServiceFactory::GetForProfile(profile_); |
| 259 policy_service->FetchPolicyForSignedInUser( | 259 policy_service->FetchPolicyForSignedInUser( |
| 260 signin->GetUsernameForAuthInProgress(), | 260 signin->GetUsernameForAuthInProgress(), |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 false /* user_gesture */); | 682 false /* user_gesture */); |
| 683 } | 683 } |
| 684 | 684 |
| 685 void OneClickSigninSyncStarter::LoadContinueUrl() { | 685 void OneClickSigninSyncStarter::LoadContinueUrl() { |
| 686 web_contents()->GetController().LoadURL( | 686 web_contents()->GetController().LoadURL( |
| 687 continue_url_, | 687 continue_url_, |
| 688 content::Referrer(), | 688 content::Referrer(), |
| 689 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 689 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 690 std::string()); | 690 std::string()); |
| 691 } | 691 } |
| OLD | NEW |