| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ | 5 #ifndef IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ |
| 6 #define IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ | 6 #define IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "components/content_settings/core/browser/cookie_settings.h" | 13 #include "components/content_settings/core/browser/cookie_settings.h" |
| 14 #include "net/base/network_delegate_impl.h" | 14 #include "net/base/network_delegate_impl.h" |
| 15 | 15 |
| 16 class PrefService; | 16 class PrefService; |
| 17 | 17 |
| 18 template <typename T> | 18 template <typename T> |
| 19 class PrefMember; | 19 class PrefMember; |
| 20 | 20 |
| 21 typedef PrefMember<bool> BooleanPrefMember; | 21 typedef PrefMember<bool> BooleanPrefMember; |
| 22 | 22 |
| 23 namespace domain_reliability { | 23 namespace domain_reliability { |
| 24 class DomainReliabilityMonitor; | 24 class DomainReliabilityMonitor; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace policy { | |
| 28 class URLBlacklistManager; | |
| 29 } | |
| 30 | |
| 31 // IOSChromeNetworkDelegate is the central point from within the Chrome code to | 27 // IOSChromeNetworkDelegate is the central point from within the Chrome code to |
| 32 // add hooks into the network stack. | 28 // add hooks into the network stack. |
| 33 class IOSChromeNetworkDelegate : public net::NetworkDelegateImpl { | 29 class IOSChromeNetworkDelegate : public net::NetworkDelegateImpl { |
| 34 public: | 30 public: |
| 35 IOSChromeNetworkDelegate(); | 31 IOSChromeNetworkDelegate(); |
| 36 ~IOSChromeNetworkDelegate() override; | 32 ~IOSChromeNetworkDelegate() override; |
| 37 | 33 |
| 38 #if defined(ENABLE_CONFIGURATION_POLICY) | |
| 39 void set_url_blacklist_manager( | |
| 40 const policy::URLBlacklistManager* url_blacklist_manager) { | |
| 41 url_blacklist_manager_ = url_blacklist_manager; | |
| 42 } | |
| 43 #endif | |
| 44 | |
| 45 // If |cookie_settings| is null or not set, all cookies are enabled, | 34 // If |cookie_settings| is null or not set, all cookies are enabled, |
| 46 // otherwise the settings are enforced on all observed network requests. | 35 // otherwise the settings are enforced on all observed network requests. |
| 47 // Not inlined because we assign a scoped_refptr, which requires us to include | 36 // Not inlined because we assign a scoped_refptr, which requires us to include |
| 48 // the header file. Here we just forward-declare it. | 37 // the header file. Here we just forward-declare it. |
| 49 void set_cookie_settings(content_settings::CookieSettings* cookie_settings) { | 38 void set_cookie_settings(content_settings::CookieSettings* cookie_settings) { |
| 50 cookie_settings_ = cookie_settings; | 39 cookie_settings_ = cookie_settings; |
| 51 } | 40 } |
| 52 | 41 |
| 53 void set_enable_do_not_track(BooleanPrefMember* enable_do_not_track) { | 42 void set_enable_do_not_track(BooleanPrefMember* enable_do_not_track) { |
| 54 enable_do_not_track_ = enable_do_not_track; | 43 enable_do_not_track_ = enable_do_not_track; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const GURL& referrer_url) const override; | 82 const GURL& referrer_url) const override; |
| 94 | 83 |
| 95 void AccumulateContentLength(int64 received_payload_byte_count, | 84 void AccumulateContentLength(int64 received_payload_byte_count, |
| 96 int64 original_payload_byte_count); | 85 int64 original_payload_byte_count); |
| 97 | 86 |
| 98 scoped_refptr<content_settings::CookieSettings> cookie_settings_; | 87 scoped_refptr<content_settings::CookieSettings> cookie_settings_; |
| 99 | 88 |
| 100 // Weak, owned by our owner. | 89 // Weak, owned by our owner. |
| 101 BooleanPrefMember* enable_do_not_track_; | 90 BooleanPrefMember* enable_do_not_track_; |
| 102 | 91 |
| 103 // Weak, owned by our owner. | 92 // Weak, owned by our owner. |
| 104 #if defined(ENABLE_CONFIGURATION_POLICY) | |
| 105 const policy::URLBlacklistManager* url_blacklist_manager_; | |
| 106 #endif | |
| 107 domain_reliability::DomainReliabilityMonitor* domain_reliability_monitor_; | 93 domain_reliability::DomainReliabilityMonitor* domain_reliability_monitor_; |
| 108 | 94 |
| 109 DISALLOW_COPY_AND_ASSIGN(IOSChromeNetworkDelegate); | 95 DISALLOW_COPY_AND_ASSIGN(IOSChromeNetworkDelegate); |
| 110 }; | 96 }; |
| 111 | 97 |
| 112 #endif // IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ | 98 #endif // IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ |
| OLD | NEW |