| 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 | 10 |
| 11 #if defined(ENABLE_CONFIGURATION_POLICY) | 11 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 12 #include "chrome/browser/policy/cloud/user_policy_signin_service.h" | 12 #include "chrome/browser/policy/cloud/user_policy_signin_service.h" |
| 13 #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h" | 13 #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h" |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/profiles/profile_info_cache.h" | 17 #include "chrome/browser/profiles/profile_info_cache.h" |
| 18 #include "chrome/browser/profiles/profile_io_data.h" | 18 #include "chrome/browser/profiles/profile_io_data.h" |
| 19 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
| 20 #include "chrome/browser/profiles/profile_window.h" |
| 20 #include "chrome/browser/signin/signin_manager.h" | 21 #include "chrome/browser/signin/signin_manager.h" |
| 21 #include "chrome/browser/signin/signin_manager_factory.h" | 22 #include "chrome/browser/signin/signin_manager_factory.h" |
| 22 #include "chrome/browser/sync/profile_sync_service.h" | 23 #include "chrome/browser/sync/profile_sync_service.h" |
| 23 #include "chrome/browser/sync/profile_sync_service_factory.h" | 24 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 24 #include "chrome/browser/sync/sync_prefs.h" | 25 #include "chrome/browser/sync/sync_prefs.h" |
| 25 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 26 #include "chrome/browser/ui/browser_dialogs.h" | 27 #include "chrome/browser/ui/browser_dialogs.h" |
| 27 #include "chrome/browser/ui/browser_finder.h" | 28 #include "chrome/browser/ui/browser_finder.h" |
| 28 #include "chrome/browser/ui/browser_list.h" | 29 #include "chrome/browser/ui/browser_list.h" |
| 29 #include "chrome/browser/ui/browser_navigator.h" | 30 #include "chrome/browser/ui/browser_navigator.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 // the signin for the original profile was cancelled (must do this after | 268 // the signin for the original profile was cancelled (must do this after |
| 268 // we have called Initialize() with the new profile, as otherwise this | 269 // we have called Initialize() with the new profile, as otherwise this |
| 269 // object will get freed when the signin on the old profile is cancelled. | 270 // object will get freed when the signin on the old profile is cancelled. |
| 270 old_signin_manager->SignOut(); | 271 old_signin_manager->SignOut(); |
| 271 | 272 |
| 272 // Load policy for the just-created profile - once policy has finished | 273 // Load policy for the just-created profile - once policy has finished |
| 273 // loading the signin process will complete. | 274 // loading the signin process will complete. |
| 274 LoadPolicyWithCachedClient(); | 275 LoadPolicyWithCachedClient(); |
| 275 | 276 |
| 276 // Open the profile's first window, after all initialization. | 277 // Open the profile's first window, after all initialization. |
| 277 ProfileManager::FindOrCreateNewWindowForProfile( | 278 profiles::FindOrCreateNewWindowForProfile( |
| 278 new_profile, | 279 new_profile, |
| 279 chrome::startup::IS_PROCESS_STARTUP, | 280 chrome::startup::IS_PROCESS_STARTUP, |
| 280 chrome::startup::IS_FIRST_RUN, | 281 chrome::startup::IS_FIRST_RUN, |
| 281 desktop_type, | 282 desktop_type, |
| 282 false); | 283 false); |
| 283 break; | 284 break; |
| 284 } | 285 } |
| 285 case Profile::CREATE_STATUS_REMOTE_FAIL: | 286 case Profile::CREATE_STATUS_REMOTE_FAIL: |
| 286 case Profile::CREATE_STATUS_CANCELED: | 287 case Profile::CREATE_STATUS_CANCELED: |
| 287 case Profile::MAX_CREATE_STATUS: { | 288 case Profile::MAX_CREATE_STATUS: { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 452 |
| 452 void OneClickSigninSyncStarter::ShowSyncSettingsPageOnSameTab() { | 453 void OneClickSigninSyncStarter::ShowSyncSettingsPageOnSameTab() { |
| 453 std::string url = std::string(chrome::kChromeUISettingsURL) + | 454 std::string url = std::string(chrome::kChromeUISettingsURL) + |
| 454 chrome::kSyncSetupSubPage; | 455 chrome::kSyncSetupSubPage; |
| 455 chrome::NavigateParams params( | 456 chrome::NavigateParams params( |
| 456 browser_, GURL(url), content::PAGE_TRANSITION_AUTO_TOPLEVEL); | 457 browser_, GURL(url), content::PAGE_TRANSITION_AUTO_TOPLEVEL); |
| 457 params.disposition = CURRENT_TAB; | 458 params.disposition = CURRENT_TAB; |
| 458 params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 459 params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
| 459 chrome::Navigate(¶ms); | 460 chrome::Navigate(¶ms); |
| 460 } | 461 } |
| OLD | NEW |