| 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 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "chrome/browser/net/safe_search_util.h" | 19 #include "chrome/browser/net/safe_search_util.h" |
| 20 #include "components/data_use_measurement/content/data_use_measurement.h" | |
| 21 #include "components/metrics/data_use_tracker.h" | |
| 22 #include "components/prefs/pref_member.h" | 20 #include "components/prefs/pref_member.h" |
| 23 #include "net/base/network_delegate_impl.h" | 21 #include "net/base/network_delegate_impl.h" |
| 24 | 22 |
| 25 class ChromeExtensionsNetworkDelegate; | 23 class ChromeExtensionsNetworkDelegate; |
| 26 class PrefService; | 24 class PrefService; |
| 27 | 25 |
| 28 template<class T> class PrefMember; | 26 template<class T> class PrefMember; |
| 29 | 27 |
| 30 typedef PrefMember<bool> BooleanPrefMember; | 28 typedef PrefMember<bool> BooleanPrefMember; |
| 31 | 29 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 58 class URLBlacklistManager; | 56 class URLBlacklistManager; |
| 59 } | 57 } |
| 60 | 58 |
| 61 // ChromeNetworkDelegate is the central point from within the chrome code to | 59 // ChromeNetworkDelegate is the central point from within the chrome code to |
| 62 // add hooks into the network stack. | 60 // add hooks into the network stack. |
| 63 class ChromeNetworkDelegate : public net::NetworkDelegateImpl { | 61 class ChromeNetworkDelegate : public net::NetworkDelegateImpl { |
| 64 public: | 62 public: |
| 65 // |enable_referrers| (and all of the other optional PrefMembers) should be | 63 // |enable_referrers| (and all of the other optional PrefMembers) should be |
| 66 // initialized on the UI thread (see below) beforehand. This object's owner is | 64 // initialized on the UI thread (see below) beforehand. This object's owner is |
| 67 // responsible for cleaning them up at shutdown. | 65 // responsible for cleaning them up at shutdown. |
| 68 ChromeNetworkDelegate( | 66 ChromeNetworkDelegate(extensions::EventRouterForwarder* event_router, |
| 69 extensions::EventRouterForwarder* event_router, | 67 BooleanPrefMember* enable_referrers); |
| 70 BooleanPrefMember* enable_referrers, | |
| 71 const metrics::UpdateUsagePrefCallbackType& metrics_data_use_forwarder); | |
| 72 ~ChromeNetworkDelegate() override; | 68 ~ChromeNetworkDelegate() override; |
| 73 | 69 |
| 74 // Pass through to ChromeExtensionsNetworkDelegate::set_extension_info_map(). | 70 // Pass through to ChromeExtensionsNetworkDelegate::set_extension_info_map(). |
| 75 void set_extension_info_map(extensions::InfoMap* extension_info_map); | 71 void set_extension_info_map(extensions::InfoMap* extension_info_map); |
| 76 | 72 |
| 77 void set_url_blacklist_manager( | 73 void set_url_blacklist_manager( |
| 78 const policy::URLBlacklistManager* url_blacklist_manager) { | 74 const policy::URLBlacklistManager* url_blacklist_manager) { |
| 79 url_blacklist_manager_ = url_blacklist_manager; | 75 url_blacklist_manager_ = url_blacklist_manager; |
| 80 } | 76 } |
| 81 | 77 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 IntegerPrefMember* force_youtube_restrict_; | 205 IntegerPrefMember* force_youtube_restrict_; |
| 210 StringPrefMember* allowed_domains_for_apps_; | 206 StringPrefMember* allowed_domains_for_apps_; |
| 211 | 207 |
| 212 // Weak, owned by our owner. | 208 // Weak, owned by our owner. |
| 213 const policy::URLBlacklistManager* url_blacklist_manager_; | 209 const policy::URLBlacklistManager* url_blacklist_manager_; |
| 214 domain_reliability::DomainReliabilityMonitor* domain_reliability_monitor_; | 210 domain_reliability::DomainReliabilityMonitor* domain_reliability_monitor_; |
| 215 | 211 |
| 216 // When true, allow access to all file:// URLs. | 212 // When true, allow access to all file:// URLs. |
| 217 static bool g_allow_file_access_; | 213 static bool g_allow_file_access_; |
| 218 | 214 |
| 219 // Component to measure data use. | |
| 220 data_use_measurement::DataUseMeasurement data_use_measurement_; | |
| 221 | |
| 222 bool experimental_web_platform_features_enabled_; | 215 bool experimental_web_platform_features_enabled_; |
| 223 | 216 |
| 224 // Aggregates and reports network usage. | 217 // Aggregates and reports network usage. |
| 225 data_usage::DataUseAggregator* data_use_aggregator_; | 218 data_usage::DataUseAggregator* data_use_aggregator_; |
| 226 // Controls whether network usage is reported as being off the record. | 219 // Controls whether network usage is reported as being off the record. |
| 227 bool is_data_usage_off_the_record_; | 220 bool is_data_usage_off_the_record_; |
| 228 | 221 |
| 229 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 222 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
| 230 }; | 223 }; |
| 231 | 224 |
| 232 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 225 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| OLD | NEW |