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 #include "chrome/browser/policy/cloud/policy_header_service.h" | |
| 49 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" | |
| 50 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" | |
| 51 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | |
|
Joao da Silva
2013/12/09 14:46:21
#if defined(ENABLE_CONFIGURATION_POLICY)
Andrew T Wilson (Slow)
2013/12/10 07:15:56
Done.
| |
| 48 #include "chrome/browser/policy/url_blacklist_manager.h" | 52 #include "chrome/browser/policy/url_blacklist_manager.h" |
| 49 #include "chrome/browser/predictors/resource_prefetch_predictor.h" | 53 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| 50 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | 54 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
| 51 #include "chrome/browser/profiles/profile.h" | 55 #include "chrome/browser/profiles/profile.h" |
| 52 #include "chrome/browser/profiles/profile_manager.h" | 56 #include "chrome/browser/profiles/profile_manager.h" |
| 53 #include "chrome/browser/signin/signin_names_io_thread.h" | 57 #include "chrome/browser/signin/signin_names_io_thread.h" |
| 54 #include "chrome/common/chrome_paths.h" | 58 #include "chrome/common/chrome_paths.h" |
| 55 #include "chrome/common/chrome_switches.h" | 59 #include "chrome/common/chrome_switches.h" |
| 56 #include "chrome/common/pref_names.h" | 60 #include "chrome/common/pref_names.h" |
| 57 #include "chrome/common/url_constants.h" | 61 #include "chrome/common/url_constants.h" |
| 62 #include "components/policy/core/browser/policy_header_io_helper.h" | |
|
Joao da Silva
2013/12/09 14:46:21
#if defined(...)
Andrew T Wilson (Slow)
2013/12/10 07:15:56
Done.
| |
| 58 #include "components/startup_metric_utils/startup_metric_utils.h" | 63 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 59 #include "content/public/browser/browser_thread.h" | 64 #include "content/public/browser/browser_thread.h" |
| 60 #include "content/public/browser/host_zoom_map.h" | 65 #include "content/public/browser/host_zoom_map.h" |
| 61 #include "content/public/browser/notification_service.h" | 66 #include "content/public/browser/notification_service.h" |
| 62 #include "content/public/browser/resource_context.h" | 67 #include "content/public/browser/resource_context.h" |
| 63 #include "extensions/browser/info_map.h" | 68 #include "extensions/browser/info_map.h" |
| 64 #include "extensions/common/constants.h" | 69 #include "extensions/common/constants.h" |
| 65 #include "net/cookies/canonical_cookie.h" | 70 #include "net/cookies/canonical_cookie.h" |
| 66 #include "net/cookies/cookie_monster.h" | 71 #include "net/cookies/cookie_monster.h" |
| 67 #include "net/http/http_transaction_factory.h" | 72 #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) | 468 #if defined(OS_CHROMEOS) |
| 464 cert_verifier_ = policy::PolicyCertServiceFactory::CreateForProfile(profile); | 469 cert_verifier_ = policy::PolicyCertServiceFactory::CreateForProfile(profile); |
| 465 #endif | 470 #endif |
| 466 // The URLBlacklistManager has to be created on the UI thread to register | 471 // 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 | 472 // observers of |pref_service|, and it also has to clean up on |
| 468 // ShutdownOnUIThread to release these observers on the right thread. | 473 // 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, | 474 // 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. | 475 // in particular when this ProfileIOData isn't |initialized_| during deletion. |
| 471 #if defined(ENABLE_CONFIGURATION_POLICY) | 476 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 472 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); | 477 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); |
| 478 | |
| 479 if (!is_incognito()) { | |
| 480 // Add policy headers for non-incognito requests. | |
| 481 policy::PolicyHeaderService* policy_header_service = | |
| 482 policy::PolicyHeaderServiceFactory::GetForBrowserContext(profile); | |
| 483 if (policy_header_service) { | |
| 484 policy_header_helper_ = policy_header_service->CreatePolicyHeaderIOHelper( | |
| 485 io_message_loop_proxy).Pass(); | |
| 486 } | |
| 487 } | |
| 473 #endif | 488 #endif |
| 474 | 489 |
| 475 initialized_on_UI_thread_ = true; | 490 initialized_on_UI_thread_ = true; |
| 476 | 491 |
| 477 // We need to make sure that content initializes its own data structures that | 492 // We need to make sure that content initializes its own data structures that |
| 478 // are associated with each ResourceContext because we might post this | 493 // are associated with each ResourceContext because we might post this |
| 479 // object to the IO thread after this function. | 494 // object to the IO thread after this function. |
| 480 BrowserContext::EnsureResourceContextInitialized(profile); | 495 BrowserContext::EnsureResourceContextInitialized(profile); |
| 481 } | 496 } |
| 482 | 497 |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1118 void ProfileIOData::SetCookieSettingsForTesting( | 1133 void ProfileIOData::SetCookieSettingsForTesting( |
| 1119 CookieSettings* cookie_settings) { | 1134 CookieSettings* cookie_settings) { |
| 1120 DCHECK(!cookie_settings_.get()); | 1135 DCHECK(!cookie_settings_.get()); |
| 1121 cookie_settings_ = cookie_settings; | 1136 cookie_settings_ = cookie_settings; |
| 1122 } | 1137 } |
| 1123 | 1138 |
| 1124 void ProfileIOData::set_signin_names_for_testing( | 1139 void ProfileIOData::set_signin_names_for_testing( |
| 1125 SigninNamesOnIOThread* signin_names) { | 1140 SigninNamesOnIOThread* signin_names) { |
| 1126 signin_names_.reset(signin_names); | 1141 signin_names_.reset(signin_names); |
| 1127 } | 1142 } |
| OLD | NEW |