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

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: removed usage of SigninManager 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/cookies/canonical_cookie.h" 65 #include "net/cookies/canonical_cookie.h"
(...skipping 10 matching lines...) Expand all
76 #include "net/url_request/file_protocol_handler.h" 76 #include "net/url_request/file_protocol_handler.h"
77 #include "net/url_request/ftp_protocol_handler.h" 77 #include "net/url_request/ftp_protocol_handler.h"
78 #include "net/url_request/protocol_intercept_job_factory.h" 78 #include "net/url_request/protocol_intercept_job_factory.h"
79 #include "net/url_request/url_request.h" 79 #include "net/url_request/url_request.h"
80 #include "net/url_request/url_request_file_job.h" 80 #include "net/url_request/url_request_file_job.h"
81 #include "net/url_request/url_request_job_factory_impl.h" 81 #include "net/url_request/url_request_job_factory_impl.h"
82 82
83 #if defined(ENABLE_CONFIGURATION_POLICY) 83 #if defined(ENABLE_CONFIGURATION_POLICY)
84 #include "chrome/browser/policy/cloud/policy_header_service.h" 84 #include "chrome/browser/policy/cloud/policy_header_service.h"
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.h" 86 #include "chrome/browser/policy/policy_helpers.h"
87 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" 87 #include "chrome/browser/policy/url_blacklist_manager.h"
88 #include "components/policy/core/browser/policy_header_io_helper.h" 88 #include "components/policy/core/browser/policy_header_io_helper.h"
89 #endif 89 #endif
90 90
91 #if defined(ENABLE_MANAGED_USERS) 91 #if defined(ENABLE_MANAGED_USERS)
92 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" 92 #include "chrome/browser/managed_mode/managed_mode_url_filter.h"
93 #include "chrome/browser/managed_mode/managed_user_service.h" 93 #include "chrome/browser/managed_mode/managed_user_service.h"
94 #include "chrome/browser/managed_mode/managed_user_service_factory.h" 94 #include "chrome/browser/managed_mode/managed_user_service_factory.h"
95 #endif 95 #endif
96 96
97 #if defined(OS_CHROMEOS) 97 #if defined(OS_CHROMEOS)
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 482
483 #if defined(OS_CHROMEOS) 483 #if defined(OS_CHROMEOS)
484 cert_verifier_ = policy::PolicyCertServiceFactory::CreateForProfile(profile); 484 cert_verifier_ = policy::PolicyCertServiceFactory::CreateForProfile(profile);
485 #endif 485 #endif
486 // The URLBlacklistManager has to be created on the UI thread to register 486 // The URLBlacklistManager has to be created on the UI thread to register
487 // observers of |pref_service|, and it also has to clean up on 487 // observers of |pref_service|, and it also has to clean up on
488 // ShutdownOnUIThread to release these observers on the right thread. 488 // ShutdownOnUIThread to release these observers on the right thread.
489 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, 489 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up,
490 // in particular when this ProfileIOData isn't |initialized_| during deletion. 490 // in particular when this ProfileIOData isn't |initialized_| during deletion.
491 #if defined(ENABLE_CONFIGURATION_POLICY) 491 #if defined(ENABLE_CONFIGURATION_POLICY)
492 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); 492 policy::URLBlacklist::SegmentURLCallback callback =
493 static_cast<policy::URLBlacklist::SegmentURLCallback>(
494 URLFixerUpper::SegmentURL);
Elliot Glaysher 2013/12/12 19:16:55 Why do you need this cast here? Is it because of t
Joao da Silva 2013/12/13 11:00:01 Yes, otherwise this fails because SegmentURL is am
495 url_blacklist_manager_.reset(
496 new policy::URLBlacklistManager(pref_service,
497 io_message_loop_proxy,
498 callback,
499 policy::SkipBlacklistForURL));
493 500
494 if (!is_incognito()) { 501 if (!is_incognito()) {
495 // Add policy headers for non-incognito requests. 502 // Add policy headers for non-incognito requests.
496 policy::PolicyHeaderService* policy_header_service = 503 policy::PolicyHeaderService* policy_header_service =
497 policy::PolicyHeaderServiceFactory::GetForBrowserContext(profile); 504 policy::PolicyHeaderServiceFactory::GetForBrowserContext(profile);
498 if (policy_header_service) { 505 if (policy_header_service) {
499 policy_header_helper_ = policy_header_service->CreatePolicyHeaderIOHelper( 506 policy_header_helper_ = policy_header_service->CreatePolicyHeaderIOHelper(
500 io_message_loop_proxy); 507 io_message_loop_proxy);
501 } 508 }
502 } 509 }
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 void ProfileIOData::SetCookieSettingsForTesting( 1158 void ProfileIOData::SetCookieSettingsForTesting(
1152 CookieSettings* cookie_settings) { 1159 CookieSettings* cookie_settings) {
1153 DCHECK(!cookie_settings_.get()); 1160 DCHECK(!cookie_settings_.get());
1154 cookie_settings_ = cookie_settings; 1161 cookie_settings_ = cookie_settings;
1155 } 1162 }
1156 1163
1157 void ProfileIOData::set_signin_names_for_testing( 1164 void ProfileIOData::set_signin_names_for_testing(
1158 SigninNamesOnIOThread* signin_names) { 1165 SigninNamesOnIOThread* signin_names) {
1159 signin_names_.reset(signin_names); 1166 signin_names_.reset(signin_names);
1160 } 1167 }
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