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

Unified Diff: chrome/browser/net/chrome_network_delegate.h

Issue 6773006: Add enableReferrers and enableHyperlinkAuditing to contentSettings.misc API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/chrome_network_delegate.h
diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h
index 9c75dd95a891c93979e77add9db9e19f534a8876..279f7024ea2eeee19d05d6361b4484a8c3c551f5 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -12,20 +12,31 @@
#include "net/base/network_delegate.h"
class ExtensionEventRouterForwarder;
+template<class T> class PrefMember;
class ProtocolHandlerRegistry;
+typedef PrefMember<bool> BooleanPrefMember;
+
// ChromeNetworkDelegate is the central point from within the chrome code to
// add hooks into the network stack.
class ChromeNetworkDelegate : public net::NetworkDelegate {
public:
// If |profile_id| is the invalid profile, events will be broadcasted to all
// profiles, otherwise, they will only be sent to the specified profile.
+ // |enable_referrers| is a PrefMember which should be passed to initialized
+ // on the UI thread (see below) beforehand. This object's owner is responsible
+ // for cleaning it up at shutdown.
explicit ChromeNetworkDelegate(
ExtensionEventRouterForwarder* event_router,
ProfileId profile_id,
+ BooleanPrefMember* enable_referrers,
ProtocolHandlerRegistry* protocol_handler_registry);
virtual ~ChromeNetworkDelegate();
+ // Binds |enable_referrers| to |pref_service| and moves it to the IO thread.
+ // This method should be called on the UI thread.
+ static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers,
+ PrefService* pref_service);
private:
// NetworkDelegate methods:
virtual int OnBeforeURLRequest(net::URLRequest* request,
@@ -41,6 +52,9 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
scoped_refptr<ExtensionEventRouterForwarder> event_router_;
const ProfileId profile_id_;
+
+ // Weak, owned by our owner.
+ BooleanPrefMember* enable_referrers_;
scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_;
DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698