Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 110643005: Refactored the URLBlacklistManager to avoid chrome/ and content/ dependencies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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/url_blacklist_manager.h"
49 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 48 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
50 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" 49 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
51 #include "chrome/browser/profiles/profile.h" 50 #include "chrome/browser/profiles/profile.h"
52 #include "chrome/browser/profiles/profile_manager.h" 51 #include "chrome/browser/profiles/profile_manager.h"
53 #include "chrome/browser/signin/signin_names_io_thread.h" 52 #include "chrome/browser/signin/signin_names_io_thread.h"
54 #include "chrome/common/chrome_paths.h" 53 #include "chrome/common/chrome_paths.h"
55 #include "chrome/common/chrome_switches.h" 54 #include "chrome/common/chrome_switches.h"
55 #include "chrome/common/net/url_fixer_upper.h"
56 #include "chrome/common/pref_names.h" 56 #include "chrome/common/pref_names.h"
57 #include "chrome/common/url_constants.h" 57 #include "chrome/common/url_constants.h"
58 #include "components/startup_metric_utils/startup_metric_utils.h" 58 #include "components/startup_metric_utils/startup_metric_utils.h"
59 #include "content/public/browser/browser_thread.h" 59 #include "content/public/browser/browser_thread.h"
60 #include "content/public/browser/host_zoom_map.h" 60 #include "content/public/browser/host_zoom_map.h"
61 #include "content/public/browser/notification_service.h" 61 #include "content/public/browser/notification_service.h"
62 #include "content/public/browser/resource_context.h" 62 #include "content/public/browser/resource_context.h"
63 #include "extensions/browser/info_map.h" 63 #include "extensions/browser/info_map.h"
64 #include "extensions/common/constants.h" 64 #include "extensions/common/constants.h"
65 #include "net/base/keygen_handler.h" 65 #include "net/base/keygen_handler.h"
(...skipping 10 matching lines...) Expand all
76 #include "net/url_request/data_protocol_handler.h" 76 #include "net/url_request/data_protocol_handler.h"
77 #include "net/url_request/file_protocol_handler.h" 77 #include "net/url_request/file_protocol_handler.h"
78 #include "net/url_request/ftp_protocol_handler.h" 78 #include "net/url_request/ftp_protocol_handler.h"
79 #include "net/url_request/protocol_intercept_job_factory.h" 79 #include "net/url_request/protocol_intercept_job_factory.h"
80 #include "net/url_request/url_request.h" 80 #include "net/url_request/url_request.h"
81 #include "net/url_request/url_request_file_job.h" 81 #include "net/url_request/url_request_file_job.h"
82 #include "net/url_request/url_request_job_factory_impl.h" 82 #include "net/url_request/url_request_job_factory_impl.h"
83 83
84 #if defined(ENABLE_CONFIGURATION_POLICY) 84 #if defined(ENABLE_CONFIGURATION_POLICY)
85 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" 85 #include "chrome/browser/policy/cloud/policy_header_service_factory.h"
86 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" 86 #include "chrome/browser/policy/policy_helpers.h"
87 #include "chrome/browser/policy/url_blacklist_manager.h"
87 #include "components/policy/core/common/cloud/policy_header_io_helper.h" 88 #include "components/policy/core/common/cloud/policy_header_io_helper.h"
88 #include "components/policy/core/common/cloud/policy_header_service.h" 89 #include "components/policy/core/common/cloud/policy_header_service.h"
89 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" 90 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
90 #endif 91 #endif
91 92
92 #if defined(ENABLE_MANAGED_USERS) 93 #if defined(ENABLE_MANAGED_USERS)
93 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" 94 #include "chrome/browser/managed_mode/managed_mode_url_filter.h"
94 #include "chrome/browser/managed_mode/managed_user_service.h" 95 #include "chrome/browser/managed_mode/managed_user_service.h"
95 #include "chrome/browser/managed_mode/managed_user_service_factory.h" 96 #include "chrome/browser/managed_mode/managed_user_service_factory.h"
96 #endif 97 #endif
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 484
484 #if defined(OS_CHROMEOS) 485 #if defined(OS_CHROMEOS)
485 cert_verifier_ = policy::PolicyCertServiceFactory::CreateForProfile(profile); 486 cert_verifier_ = policy::PolicyCertServiceFactory::CreateForProfile(profile);
486 #endif 487 #endif
487 // The URLBlacklistManager has to be created on the UI thread to register 488 // The URLBlacklistManager has to be created on the UI thread to register
488 // observers of |pref_service|, and it also has to clean up on 489 // observers of |pref_service|, and it also has to clean up on
489 // ShutdownOnUIThread to release these observers on the right thread. 490 // ShutdownOnUIThread to release these observers on the right thread.
490 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, 491 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up,
491 // in particular when this ProfileIOData isn't |initialized_| during deletion. 492 // in particular when this ProfileIOData isn't |initialized_| during deletion.
492 #if defined(ENABLE_CONFIGURATION_POLICY) 493 #if defined(ENABLE_CONFIGURATION_POLICY)
493 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); 494 policy::URLBlacklist::SegmentURLCallback callback =
495 static_cast<policy::URLBlacklist::SegmentURLCallback>(
496 URLFixerUpper::SegmentURL);
497 url_blacklist_manager_.reset(
498 new policy::URLBlacklistManager(pref_service,
499 io_message_loop_proxy,
500 callback,
501 policy::SkipBlacklistForURL));
494 502
495 if (!is_incognito()) { 503 if (!is_incognito()) {
496 // Add policy headers for non-incognito requests. 504 // Add policy headers for non-incognito requests.
497 policy::PolicyHeaderService* policy_header_service = 505 policy::PolicyHeaderService* policy_header_service =
498 policy::PolicyHeaderServiceFactory::GetForBrowserContext(profile); 506 policy::PolicyHeaderServiceFactory::GetForBrowserContext(profile);
499 if (policy_header_service) { 507 if (policy_header_service) {
500 policy_header_helper_ = policy_header_service->CreatePolicyHeaderIOHelper( 508 policy_header_helper_ = policy_header_service->CreatePolicyHeaderIOHelper(
501 io_message_loop_proxy); 509 io_message_loop_proxy);
502 } 510 }
503 } 511 }
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 void ProfileIOData::SetCookieSettingsForTesting( 1191 void ProfileIOData::SetCookieSettingsForTesting(
1184 CookieSettings* cookie_settings) { 1192 CookieSettings* cookie_settings) {
1185 DCHECK(!cookie_settings_.get()); 1193 DCHECK(!cookie_settings_.get());
1186 cookie_settings_ = cookie_settings; 1194 cookie_settings_ = cookie_settings;
1187 } 1195 }
1188 1196
1189 void ProfileIOData::set_signin_names_for_testing( 1197 void ProfileIOData::set_signin_names_for_testing(
1190 SigninNamesOnIOThread* signin_names) { 1198 SigninNamesOnIOThread* signin_names) {
1191 signin_names_.reset(signin_names); 1199 signin_names_.reset(signin_names);
1192 } 1200 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/url_blacklist_policy_handler_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698