| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 browser_ = EnsureBrowser(browser_, profile_); | 234 browser_ = EnsureBrowser(browser_, profile_); |
| 235 content::WebContents* web_contents = | 235 content::WebContents* web_contents = |
| 236 browser_->tab_strip_model()->GetActiveWebContents(); | 236 browser_->tab_strip_model()->GetActiveWebContents(); |
| 237 if (!web_contents) { | 237 if (!web_contents) { |
| 238 CancelSigninAndDelete(); | 238 CancelSigninAndDelete(); |
| 239 return; | 239 return; |
| 240 } | 240 } |
| 241 | 241 |
| 242 content::RecordAction( | 242 content::RecordAction( |
| 243 base::UserMetricsAction("Signin_Show_EnterpriseAccountPrompt")); | 243 base::UserMetricsAction("Signin_Show_EnterpriseAccountPrompt")); |
| 244 TabDialogs::FromWebContents(web_contents)->ShowProfileSigninConfirmation( | 244 TabDialogs::FromWebContents(web_contents) |
| 245 browser_, | 245 ->ShowProfileSigninConfirmation(browser_, profile_, |
| 246 profile_, | 246 signin->GetUsernameForAuthInProgress(), |
| 247 signin->GetUsernameForAuthInProgress(), | 247 base::MakeUnique<SigninDialogDelegate>( |
| 248 new SigninDialogDelegate(weak_pointer_factory_.GetWeakPtr())); | 248 weak_pointer_factory_.GetWeakPtr())); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void OneClickSigninSyncStarter::LoadPolicyWithCachedCredentials() { | 251 void OneClickSigninSyncStarter::LoadPolicyWithCachedCredentials() { |
| 252 DCHECK(!dm_token_.empty()); | 252 DCHECK(!dm_token_.empty()); |
| 253 DCHECK(!client_id_.empty()); | 253 DCHECK(!client_id_.empty()); |
| 254 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); | 254 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); |
| 255 policy::UserPolicySigninService* policy_service = | 255 policy::UserPolicySigninService* policy_service = |
| 256 policy::UserPolicySigninServiceFactory::GetForProfile(profile_); | 256 policy::UserPolicySigninServiceFactory::GetForProfile(profile_); |
| 257 policy_service->FetchPolicyForSignedInUser( | 257 policy_service->FetchPolicyForSignedInUser( |
| 258 signin->GetUsernameForAuthInProgress(), | 258 signin->GetUsernameForAuthInProgress(), |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 false /* user_gesture */); | 667 false /* user_gesture */); |
| 668 } | 668 } |
| 669 | 669 |
| 670 void OneClickSigninSyncStarter::LoadContinueUrl() { | 670 void OneClickSigninSyncStarter::LoadContinueUrl() { |
| 671 web_contents()->GetController().LoadURL( | 671 web_contents()->GetController().LoadURL( |
| 672 continue_url_, | 672 continue_url_, |
| 673 content::Referrer(), | 673 content::Referrer(), |
| 674 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 674 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 675 std::string()); | 675 std::string()); |
| 676 } | 676 } |
| OLD | NEW |