| 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 "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 signin_tracker_ = SigninTrackerFactory::CreateForProfile(profile_, this); | 135 signin_tracker_ = SigninTrackerFactory::CreateForProfile(profile_, this); |
| 136 | 136 |
| 137 // Let the sync service know that setup is in progress so it doesn't start | 137 // Let the sync service know that setup is in progress so it doesn't start |
| 138 // syncing until the user has finished any configuration. | 138 // syncing until the user has finished any configuration. |
| 139 ProfileSyncService* profile_sync_service = GetProfileSyncService(); | 139 ProfileSyncService* profile_sync_service = GetProfileSyncService(); |
| 140 if (profile_sync_service) | 140 if (profile_sync_service) |
| 141 profile_sync_service->SetSetupInProgress(true); | 141 profile_sync_service->SetSetupInProgress(true); |
| 142 | 142 |
| 143 // Make sure the syncing is requested, otherwise the SigninManager | 143 // Make sure the syncing is requested, otherwise the SigninManager |
| 144 // will not be able to complete sucessfully. | 144 // will not be able to complete successfully. |
| 145 sync_driver::SyncPrefs sync_prefs(profile_->GetPrefs()); | 145 sync_driver::SyncPrefs sync_prefs(profile_->GetPrefs()); |
| 146 sync_prefs.SetSyncRequested(true); | 146 sync_prefs.SetSyncRequested(true); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void OneClickSigninSyncStarter::ConfirmSignin(const std::string& oauth_token) { | 149 void OneClickSigninSyncStarter::ConfirmSignin(const std::string& oauth_token) { |
| 150 DCHECK(!oauth_token.empty()); | 150 DCHECK(!oauth_token.empty()); |
| 151 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); | 151 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); |
| 152 // If this is a new signin (no account authenticated yet) try loading | 152 // If this is a new signin (no account authenticated yet) try loading |
| 153 // policy for this user now, before any signed in services are initialized. | 153 // policy for this user now, before any signed in services are initialized. |
| 154 if (!signin->IsAuthenticated()) { | 154 if (!signin->IsAuthenticated()) { |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 false /* user_gesture */); | 605 false /* user_gesture */); |
| 606 } | 606 } |
| 607 | 607 |
| 608 void OneClickSigninSyncStarter::LoadContinueUrl() { | 608 void OneClickSigninSyncStarter::LoadContinueUrl() { |
| 609 web_contents()->GetController().LoadURL( | 609 web_contents()->GetController().LoadURL( |
| 610 continue_url_, | 610 continue_url_, |
| 611 content::Referrer(), | 611 content::Referrer(), |
| 612 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 612 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 613 std::string()); | 613 std::string()); |
| 614 } | 614 } |
| OLD | NEW |