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

Side by Side Diff: chrome/browser/net/chrome_network_delegate.h

Issue 10108026: Transmit a X-Chrome-UMA-Enabled bit to Google domains from clients that have UMA enabled. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: MAD comment Created 8 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 unified diff | Download patch
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 #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"
(...skipping 21 matching lines...) Expand all
32 // |enable_referrers| should be initialized on the UI thread (see below) 32 // |enable_referrers| should be initialized on the UI thread (see below)
33 // beforehand. This object's owner is responsible for cleaning it up at 33 // beforehand. This object's owner is responsible for cleaning it up at
34 // shutdown. If |cookie_settings| is NULL, all cookies are enabled, 34 // shutdown. If |cookie_settings| is NULL, all cookies are enabled,
35 // otherwise, the settings are enforced on all observed network requests. 35 // otherwise, the settings are enforced on all observed network requests.
36 ChromeNetworkDelegate( 36 ChromeNetworkDelegate(
37 ExtensionEventRouterForwarder* event_router, 37 ExtensionEventRouterForwarder* event_router,
38 ExtensionInfoMap* extension_info_map, 38 ExtensionInfoMap* extension_info_map,
39 const policy::URLBlacklistManager* url_blacklist_manager, 39 const policy::URLBlacklistManager* url_blacklist_manager,
40 void* profile, 40 void* profile,
41 CookieSettings* cookie_settings, 41 CookieSettings* cookie_settings,
42 bool is_incognito,
42 BooleanPrefMember* enable_referrers); 43 BooleanPrefMember* enable_referrers);
43 virtual ~ChromeNetworkDelegate(); 44 virtual ~ChromeNetworkDelegate();
44 45
45 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. 46 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread.
46 // This method should be called on the UI thread. 47 // This method should be called on the UI thread.
47 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, 48 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers,
48 PrefService* pref_service); 49 PrefService* pref_service);
49 50
50 private: 51 private:
51 // NetworkDelegate implementation. 52 // NetworkDelegate implementation.
(...skipping 24 matching lines...) Expand all
76 net::URLRequest* request, 77 net::URLRequest* request,
77 const net::AuthChallengeInfo& auth_info, 78 const net::AuthChallengeInfo& auth_info,
78 const AuthCallback& callback, 79 const AuthCallback& callback,
79 net::AuthCredentials* credentials) OVERRIDE; 80 net::AuthCredentials* credentials) OVERRIDE;
80 virtual bool CanGetCookies(const net::URLRequest* request, 81 virtual bool CanGetCookies(const net::URLRequest* request,
81 const net::CookieList& cookie_list) OVERRIDE; 82 const net::CookieList& cookie_list) OVERRIDE;
82 virtual bool CanSetCookie(const net::URLRequest* request, 83 virtual bool CanSetCookie(const net::URLRequest* request,
83 const std::string& cookie_line, 84 const std::string& cookie_line,
84 net::CookieOptions* options) OVERRIDE; 85 net::CookieOptions* options) OVERRIDE;
85 86
87 // Adds Chrome experiment and metrics state as custom headers to |headers|
88 // based on local state and |request|.
89 void AddChromeMetricsStateHeader(net::URLRequest* request,
90 net::HttpRequestHeaders* headers);
91
86 scoped_refptr<ExtensionEventRouterForwarder> event_router_; 92 scoped_refptr<ExtensionEventRouterForwarder> event_router_;
87 void* profile_; 93 void* profile_;
88 scoped_refptr<CookieSettings> cookie_settings_; 94 scoped_refptr<CookieSettings> cookie_settings_;
89 95
96 // Whether or not the profile is an Off The Record profile. Note that this
Ilya Sherman 2012/04/17 20:55:39 nit: s/Off The Record/Incognito
97 // field is not valid if |profile_| is NULL, so always check profile_ first
98 // before this field.
99 bool is_incognito_;
100
90 scoped_refptr<ExtensionInfoMap> extension_info_map_; 101 scoped_refptr<ExtensionInfoMap> extension_info_map_;
91 102
92 // Weak, owned by our owner. 103 // Weak, owned by our owner.
93 BooleanPrefMember* enable_referrers_; 104 BooleanPrefMember* enable_referrers_;
94 105
95 // Weak, owned by our owner. 106 // Weak, owned by our owner.
96 const policy::URLBlacklistManager* url_blacklist_manager_; 107 const policy::URLBlacklistManager* url_blacklist_manager_;
97 108
98 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 109 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
99 }; 110 };
100 111
101 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 112 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698