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