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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 signin_tracker_ = SigninTrackerFactory::CreateForProfile(profile_, this); | 132 signin_tracker_ = SigninTrackerFactory::CreateForProfile(profile_, this); |
133 | 133 |
134 // Let the sync service know that setup is in progress so it doesn't start | 134 // Let the sync service know that setup is in progress so it doesn't start |
135 // syncing until the user has finished any configuration. | 135 // syncing until the user has finished any configuration. |
136 ProfileSyncService* profile_sync_service = GetProfileSyncService(); | 136 ProfileSyncService* profile_sync_service = GetProfileSyncService(); |
137 if (profile_sync_service) | 137 if (profile_sync_service) |
138 sync_blocker_ = profile_sync_service->GetSetupInProgressHandle(); | 138 sync_blocker_ = profile_sync_service->GetSetupInProgressHandle(); |
139 | 139 |
140 // Make sure the syncing is requested, otherwise the SigninManager | 140 // Make sure the syncing is requested, otherwise the SigninManager |
141 // will not be able to complete successfully. | 141 // will not be able to complete successfully. |
142 sync_driver::SyncPrefs sync_prefs(profile_->GetPrefs()); | 142 syncer::SyncPrefs sync_prefs(profile_->GetPrefs()); |
143 sync_prefs.SetSyncRequested(true); | 143 sync_prefs.SetSyncRequested(true); |
144 } | 144 } |
145 | 145 |
146 void OneClickSigninSyncStarter::ConfirmSignin(const std::string& oauth_token) { | 146 void OneClickSigninSyncStarter::ConfirmSignin(const std::string& oauth_token) { |
147 DCHECK(!oauth_token.empty()); | 147 DCHECK(!oauth_token.empty()); |
148 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); | 148 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); |
149 // If this is a new signin (no account authenticated yet) try loading | 149 // If this is a new signin (no account authenticated yet) try loading |
150 // policy for this user now, before any signed in services are initialized. | 150 // policy for this user now, before any signed in services are initialized. |
151 if (!signin->IsAuthenticated()) { | 151 if (!signin->IsAuthenticated()) { |
152 policy::UserPolicySigninService* policy_service = | 152 policy::UserPolicySigninService* policy_service = |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 false /* user_gesture */); | 642 false /* user_gesture */); |
643 } | 643 } |
644 | 644 |
645 void OneClickSigninSyncStarter::LoadContinueUrl() { | 645 void OneClickSigninSyncStarter::LoadContinueUrl() { |
646 web_contents()->GetController().LoadURL( | 646 web_contents()->GetController().LoadURL( |
647 continue_url_, | 647 continue_url_, |
648 content::Referrer(), | 648 content::Referrer(), |
649 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 649 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
650 std::string()); | 650 std::string()); |
651 } | 651 } |
OLD | NEW |