| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "net/base/network_delegate.h" | 12 #include "net/base/network_delegate.h" |
| 13 | 13 |
| 14 class ExtensionEventRouterForwarder; | 14 class ExtensionEventRouterForwarder; |
| 15 class ExtensionInfoMap; | 15 class ExtensionInfoMap; |
| 16 class PrefService; | 16 class PrefService; |
| 17 template<class T> class PrefMember; | 17 template<class T> class PrefMember; |
| 18 | 18 |
| 19 typedef PrefMember<bool> BooleanPrefMember; | 19 typedef PrefMember<bool> BooleanPrefMember; |
| 20 | 20 |
| 21 namespace policy { |
| 22 class URLBlacklistManager; |
| 23 } |
| 24 |
| 21 // ChromeNetworkDelegate is the central point from within the chrome code to | 25 // ChromeNetworkDelegate is the central point from within the chrome code to |
| 22 // add hooks into the network stack. | 26 // add hooks into the network stack. |
| 23 class ChromeNetworkDelegate : public net::NetworkDelegate { | 27 class ChromeNetworkDelegate : public net::NetworkDelegate { |
| 24 public: | 28 public: |
| 25 // If |profile| is NULL, events will be broadcasted to all profiles, otherwise | 29 // If |profile| is NULL, events will be broadcasted to all profiles, otherwise |
| 26 // they will only be sent to the specified profile. | 30 // they will only be sent to the specified profile. |
| 27 // |enable_referrers| should be initialized on the UI thread (see below) | 31 // |enable_referrers| should be initialized on the UI thread (see below) |
| 28 // beforehand. This object's owner is responsible for cleaning it up | 32 // beforehand. This object's owner is responsible for cleaning it up |
| 29 // at shutdown. | 33 // at shutdown. |
| 30 ChromeNetworkDelegate( | 34 ChromeNetworkDelegate( |
| 31 ExtensionEventRouterForwarder* event_router, | 35 ExtensionEventRouterForwarder* event_router, |
| 32 ExtensionInfoMap* extension_info_map, | 36 ExtensionInfoMap* extension_info_map, |
| 37 const policy::URLBlacklistManager* url_blacklist_manager, |
| 33 void* profile, | 38 void* profile, |
| 34 BooleanPrefMember* enable_referrers); | 39 BooleanPrefMember* enable_referrers); |
| 35 virtual ~ChromeNetworkDelegate(); | 40 virtual ~ChromeNetworkDelegate(); |
| 36 | 41 |
| 37 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. | 42 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. |
| 38 // This method should be called on the UI thread. | 43 // This method should be called on the UI thread. |
| 39 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, | 44 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, |
| 40 PrefService* pref_service); | 45 PrefService* pref_service); |
| 41 | 46 |
| 42 private: | 47 private: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 const net::AuthChallengeInfo& auth_info) OVERRIDE; | 67 const net::AuthChallengeInfo& auth_info) OVERRIDE; |
| 63 | 68 |
| 64 scoped_refptr<ExtensionEventRouterForwarder> event_router_; | 69 scoped_refptr<ExtensionEventRouterForwarder> event_router_; |
| 65 void* profile_; | 70 void* profile_; |
| 66 | 71 |
| 67 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 72 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 68 | 73 |
| 69 // Weak, owned by our owner. | 74 // Weak, owned by our owner. |
| 70 BooleanPrefMember* enable_referrers_; | 75 BooleanPrefMember* enable_referrers_; |
| 71 | 76 |
| 77 // Weak, owned by our owner. |
| 78 const policy::URLBlacklistManager* url_blacklist_manager_; |
| 79 |
| 72 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 80 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
| 73 }; | 81 }; |
| 74 | 82 |
| 75 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 83 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| OLD | NEW |