| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/chromeos/cros/network_library.h" | 25 #include "chrome/browser/chromeos/cros/network_library.h" |
| 26 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 26 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 27 #include "chrome/browser/chromeos/login/background_view.h" | 27 #include "chrome/browser/chromeos/login/background_view.h" |
| 28 #include "chrome/browser/chromeos/login/cookie_fetcher.h" | 28 #include "chrome/browser/chromeos/login/cookie_fetcher.h" |
| 29 #include "chrome/browser/chromeos/login/google_authenticator.h" | 29 #include "chrome/browser/chromeos/login/google_authenticator.h" |
| 30 #include "chrome/browser/chromeos/login/language_switch_menu.h" | 30 #include "chrome/browser/chromeos/login/language_switch_menu.h" |
| 31 #include "chrome/browser/chromeos/login/ownership_service.h" | 31 #include "chrome/browser/chromeos/login/ownership_service.h" |
| 32 #include "chrome/browser/chromeos/login/parallel_authenticator.h" | 32 #include "chrome/browser/chromeos/login/parallel_authenticator.h" |
| 33 #include "chrome/browser/chromeos/login/user_image_downloader.h" | 33 #include "chrome/browser/chromeos/login/user_image_downloader.h" |
| 34 #include "chrome/browser/chromeos/login/user_manager.h" | 34 #include "chrome/browser/chromeos/login/user_manager.h" |
| 35 #include "chrome/browser/chromeos/proxy_config_service.h" | |
| 36 #include "chrome/browser/extensions/extension_service.h" | 35 #include "chrome/browser/extensions/extension_service.h" |
| 37 #include "chrome/browser/net/chrome_url_request_context.h" | 36 #include "chrome/browser/net/chrome_url_request_context.h" |
| 38 #include "chrome/browser/net/gaia/token_service.h" | 37 #include "chrome/browser/net/gaia/token_service.h" |
| 39 #include "chrome/browser/net/preconnect.h" | 38 #include "chrome/browser/net/preconnect.h" |
| 40 #include "chrome/browser/net/pref_proxy_config_service.h" | 39 #include "chrome/browser/net/pref_proxy_config_service.h" |
| 41 #include "chrome/browser/plugin_updater.h" | 40 #include "chrome/browser/plugin_updater.h" |
| 42 #include "chrome/browser/prefs/pref_member.h" | 41 #include "chrome/browser/prefs/pref_member.h" |
| 43 #include "chrome/browser/profiles/profile.h" | 42 #include "chrome/browser/profiles/profile.h" |
| 44 #include "chrome/browser/profiles/profile_manager.h" | 43 #include "chrome/browser/profiles/profile_manager.h" |
| 45 #include "chrome/browser/sync/profile_sync_service.h" | 44 #include "chrome/browser/sync/profile_sync_service.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 { | 231 { |
| 233 // Loading user profile causes us to do blocking IO on UI thread. | 232 // Loading user profile causes us to do blocking IO on UI thread. |
| 234 // Temporarily allow it until we fix http://crosbug.com/11104 | 233 // Temporarily allow it until we fix http://crosbug.com/11104 |
| 235 base::ThreadRestrictions::ScopedAllowIO allow_io; | 234 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 236 // The default profile will have been changed because the ProfileManager | 235 // The default profile will have been changed because the ProfileManager |
| 237 // will process the notification that the UserManager sends out. | 236 // will process the notification that the UserManager sends out. |
| 238 profile = profile_manager->GetDefaultProfile(user_data_dir); | 237 profile = profile_manager->GetDefaultProfile(user_data_dir); |
| 239 } | 238 } |
| 240 btl->AddLoginTimeMarker("UserProfileGotten", false); | 239 btl->AddLoginTimeMarker("UserProfileGotten", false); |
| 241 | 240 |
| 242 // Change the proxy configuration service of the default request context to | |
| 243 // use the preference configuration from the logged-in profile. This ensures | |
| 244 // that requests done through the default context use the proxy configuration | |
| 245 // provided by configuration policy. | |
| 246 // | |
| 247 // Note: Many of the clients of the default request context should probably be | |
| 248 // fixed to use the request context of the profile they are associated with. | |
| 249 // This includes preconnect, autofill, metrics service to only name a few; | |
| 250 // see http://code.google.com/p/chromium/issues/detail?id=64339 for details. | |
| 251 // | |
| 252 // TODO(mnissler) Revisit when support for device-specific policy arrives, at | |
| 253 // which point the default request context can directly be managed through | |
| 254 // device policy. | |
| 255 net::ProxyConfigService* proxy_config_service = | |
| 256 new PrefProxyConfigService( | |
| 257 profile->GetProxyConfigTracker(), | |
| 258 new chromeos::ProxyConfigService( | |
| 259 profile->GetChromeOSProxyConfigServiceImpl())); | |
| 260 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | |
| 261 new ResetDefaultProxyConfigServiceTask( | |
| 262 proxy_config_service)); | |
| 263 | |
| 264 // Since we're doing parallel authentication, only new user sign in | 241 // Since we're doing parallel authentication, only new user sign in |
| 265 // would perform online auth before calling CompleteLogin. | 242 // would perform online auth before calling CompleteLogin. |
| 266 // For existing users there's usually a pending online auth request. | 243 // For existing users there's usually a pending online auth request. |
| 267 // Cookies will be fetched after it's is succeeded. | 244 // Cookies will be fetched after it's is succeeded. |
| 268 if (!pending_requests) { | 245 if (!pending_requests) { |
| 269 FetchCookies(profile, credentials); | 246 FetchCookies(profile, credentials); |
| 270 } | 247 } |
| 271 | 248 |
| 272 // Init extension event routers; this normally happens in browser_main | 249 // Init extension event routers; this normally happens in browser_main |
| 273 // but on Chrome OS it has to be deferred until the user finishes | 250 // but on Chrome OS it has to be deferred until the user finishes |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 BrowserInit browser_init; | 551 BrowserInit browser_init; |
| 575 int return_code; | 552 int return_code; |
| 576 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 553 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
| 577 profile, | 554 profile, |
| 578 FilePath(), | 555 FilePath(), |
| 579 true, | 556 true, |
| 580 &return_code); | 557 &return_code); |
| 581 } | 558 } |
| 582 | 559 |
| 583 } // namespace chromeos | 560 } // namespace chromeos |
| OLD | NEW |