Chromium Code Reviews| 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/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 #include "chrome/browser/net/about_protocol_handler.h" | 38 #include "chrome/browser/net/about_protocol_handler.h" |
| 39 #include "chrome/browser/net/chrome_cookie_notification_details.h" | 39 #include "chrome/browser/net/chrome_cookie_notification_details.h" |
| 40 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" | 40 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
| 41 #include "chrome/browser/net/chrome_http_user_agent_settings.h" | 41 #include "chrome/browser/net/chrome_http_user_agent_settings.h" |
| 42 #include "chrome/browser/net/chrome_net_log.h" | 42 #include "chrome/browser/net/chrome_net_log.h" |
| 43 #include "chrome/browser/net/chrome_network_delegate.h" | 43 #include "chrome/browser/net/chrome_network_delegate.h" |
| 44 #include "chrome/browser/net/evicted_domain_cookie_counter.h" | 44 #include "chrome/browser/net/evicted_domain_cookie_counter.h" |
| 45 #include "chrome/browser/net/load_time_stats.h" | 45 #include "chrome/browser/net/load_time_stats.h" |
| 46 #include "chrome/browser/net/proxy_service_factory.h" | 46 #include "chrome/browser/net/proxy_service_factory.h" |
| 47 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" | 47 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" |
| 48 #if defined(ENABLE_CONFIGURATION_POLICY) | |
| 49 #include "chrome/browser/policy/cloud/policy_header_service.h" | |
| 50 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" | |
| 51 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" | |
| 52 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | |
| 53 #endif | |
|
Joao da Silva
2013/12/10 08:34:22
Move this block below, after the unconditional #in
Andrew T Wilson (Slow)
2013/12/10 20:04:57
Done.
| |
| 48 #include "chrome/browser/policy/url_blacklist_manager.h" | 54 #include "chrome/browser/policy/url_blacklist_manager.h" |
| 49 #include "chrome/browser/predictors/resource_prefetch_predictor.h" | 55 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| 50 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | 56 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
| 51 #include "chrome/browser/profiles/profile.h" | 57 #include "chrome/browser/profiles/profile.h" |
| 52 #include "chrome/browser/profiles/profile_manager.h" | 58 #include "chrome/browser/profiles/profile_manager.h" |
| 53 #include "chrome/browser/signin/signin_names_io_thread.h" | 59 #include "chrome/browser/signin/signin_names_io_thread.h" |
| 54 #include "chrome/common/chrome_paths.h" | 60 #include "chrome/common/chrome_paths.h" |
| 55 #include "chrome/common/chrome_switches.h" | 61 #include "chrome/common/chrome_switches.h" |
| 56 #include "chrome/common/pref_names.h" | 62 #include "chrome/common/pref_names.h" |
| 57 #include "chrome/common/url_constants.h" | 63 #include "chrome/common/url_constants.h" |
| 64 #if defined(ENABLE_CONFIGURATION_POLICY) | |
| 65 #include "components/policy/core/browser/policy_header_io_helper.h" | |
| 66 #endif | |
|
Joao da Silva
2013/12/10 08:34:22
ditto
Andrew T Wilson (Slow)
2013/12/10 20:04:57
Done.
| |
| 58 #include "components/startup_metric_utils/startup_metric_utils.h" | 67 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 59 #include "content/public/browser/browser_thread.h" | 68 #include "content/public/browser/browser_thread.h" |
| 60 #include "content/public/browser/host_zoom_map.h" | 69 #include "content/public/browser/host_zoom_map.h" |
| 61 #include "content/public/browser/notification_service.h" | 70 #include "content/public/browser/notification_service.h" |
| 62 #include "content/public/browser/resource_context.h" | 71 #include "content/public/browser/resource_context.h" |
| 63 #include "extensions/browser/info_map.h" | 72 #include "extensions/browser/info_map.h" |
| 64 #include "extensions/common/constants.h" | 73 #include "extensions/common/constants.h" |
| 65 #include "net/cookies/canonical_cookie.h" | 74 #include "net/cookies/canonical_cookie.h" |
| 66 #include "net/cookies/cookie_monster.h" | 75 #include "net/cookies/cookie_monster.h" |
| 67 #include "net/http/http_transaction_factory.h" | 76 #include "net/http/http_transaction_factory.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 463 #if defined(OS_CHROMEOS) | 472 #if defined(OS_CHROMEOS) |
| 464 cert_verifier_ = policy::PolicyCertServiceFactory::CreateForProfile(profile); | 473 cert_verifier_ = policy::PolicyCertServiceFactory::CreateForProfile(profile); |
| 465 #endif | 474 #endif |
| 466 // The URLBlacklistManager has to be created on the UI thread to register | 475 // The URLBlacklistManager has to be created on the UI thread to register |
| 467 // observers of |pref_service|, and it also has to clean up on | 476 // observers of |pref_service|, and it also has to clean up on |
| 468 // ShutdownOnUIThread to release these observers on the right thread. | 477 // ShutdownOnUIThread to release these observers on the right thread. |
| 469 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, | 478 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, |
| 470 // in particular when this ProfileIOData isn't |initialized_| during deletion. | 479 // in particular when this ProfileIOData isn't |initialized_| during deletion. |
| 471 #if defined(ENABLE_CONFIGURATION_POLICY) | 480 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 472 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); | 481 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); |
| 482 | |
| 483 if (!is_incognito()) { | |
| 484 // Add policy headers for non-incognito requests. | |
| 485 policy::PolicyHeaderService* policy_header_service = | |
| 486 policy::PolicyHeaderServiceFactory::GetForBrowserContext(profile); | |
| 487 if (policy_header_service) { | |
| 488 policy_header_helper_ = policy_header_service->CreatePolicyHeaderIOHelper( | |
| 489 io_message_loop_proxy).Pass(); | |
| 490 } | |
| 491 } | |
| 473 #endif | 492 #endif |
| 474 | 493 |
| 475 initialized_on_UI_thread_ = true; | 494 initialized_on_UI_thread_ = true; |
| 476 | 495 |
| 477 // We need to make sure that content initializes its own data structures that | 496 // We need to make sure that content initializes its own data structures that |
| 478 // are associated with each ResourceContext because we might post this | 497 // are associated with each ResourceContext because we might post this |
| 479 // object to the IO thread after this function. | 498 // object to the IO thread after this function. |
| 480 BrowserContext::EnsureResourceContextInitialized(profile); | 499 BrowserContext::EnsureResourceContextInitialized(profile); |
| 481 } | 500 } |
| 482 | 501 |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1118 void ProfileIOData::SetCookieSettingsForTesting( | 1137 void ProfileIOData::SetCookieSettingsForTesting( |
| 1119 CookieSettings* cookie_settings) { | 1138 CookieSettings* cookie_settings) { |
| 1120 DCHECK(!cookie_settings_.get()); | 1139 DCHECK(!cookie_settings_.get()); |
| 1121 cookie_settings_ = cookie_settings; | 1140 cookie_settings_ = cookie_settings; |
| 1122 } | 1141 } |
| 1123 | 1142 |
| 1124 void ProfileIOData::set_signin_names_for_testing( | 1143 void ProfileIOData::set_signin_names_for_testing( |
| 1125 SigninNamesOnIOThread* signin_names) { | 1144 SigninNamesOnIOThread* signin_names) { |
| 1126 signin_names_.reset(signin_names); | 1145 signin_names_.reset(signin_names); |
| 1127 } | 1146 } |
| OLD | NEW |