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

Side by Side Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h

Issue 412143009: Moved data reduction proxy initialization logic to ProfileImplIOData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 6 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ 5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_
6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_
7 7
8 #include "base/memory/scoped_ptr.h"
8 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" 9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
9 #include "components/keyed_service/core/keyed_service.h" 10 #include "components/keyed_service/core/keyed_service.h"
10 11
12 namespace base {
13 class PrefService;
14 }
15
11 namespace data_reduction_proxy { 16 namespace data_reduction_proxy {
17 class DataReductionProxyConfigurator;
12 class DataReductionProxyParams; 18 class DataReductionProxyParams;
13 } 19 }
14 20
15 class Profile; 21 namespace net {
22 class URLRequestContextGetter;
23 }
24
25 class PrefService;
16 26
17 // Data reduction proxy settings class suitable for use with a Chrome browser. 27 // Data reduction proxy settings class suitable for use with a Chrome browser.
18 // It is keyed to a browser context. 28 // It is keyed to a browser context.
19 class DataReductionProxyChromeSettings 29 class DataReductionProxyChromeSettings
20 : public data_reduction_proxy::DataReductionProxySettings, 30 : public data_reduction_proxy::DataReductionProxySettings,
21 public KeyedService { 31 public KeyedService {
22 public: 32 public:
23 // Constructs a settings object with the given configuration parameters. 33 // Constructs a settings object with the given configuration parameters.
24 // Construction and destruction must happen on the UI thread. 34 // Construction and destruction must happen on the UI thread.
25 explicit DataReductionProxyChromeSettings( 35 explicit DataReductionProxyChromeSettings(
26 data_reduction_proxy::DataReductionProxyParams* params); 36 data_reduction_proxy::DataReductionProxyParams* params);
27 37
28 // Destructs the settings object. 38 // Destructs the settings object.
29 virtual ~DataReductionProxyChromeSettings(); 39 virtual ~DataReductionProxyChromeSettings();
30 40
31 // Initialize the settings object with the given profile, which it uses to 41 // Initialize the settings object with the given configurator, prefs services,
32 // get the appropriate pref service. 42 // and request context.
33 virtual void InitDataReductionProxySettings(Profile* profile); 43 void InitDataReductionProxySettings(
44 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
45 configurator,
46 PrefService* profile_prefs,
47 PrefService* local_state_prefs,
48 net::URLRequestContextGetter* request_context);
34 49
35 // Using the chrome::VersionInfo version, returns the build and patch portion 50 // Using the chrome::VersionInfo version, returns the build and patch portion
36 // of the string delimited by a period. If the chrome::VersionInfo version 51 // of the string delimited by a period. If the chrome::VersionInfo version
37 // isn't of the form xx.xx.xx.xx returns an empty string. 52 // isn't of the form xx.xx.xx.xx returns an empty string.
38 static std::string GetBuildAndPatchNumber(); 53 static std::string GetBuildAndPatchNumber();
39 54
40 // Gets the client type for the data reduction proxy. 55 // Gets the client type for the data reduction proxy.
41 static std::string GetClient(); 56 static std::string GetClient();
42 57
43 private: 58 private:
44 // Registers the DataReductionProxyEnabled synthetic field trial with 59 // Registers the DataReductionProxyEnabled synthetic field trial with
45 // the group |data_reduction_proxy_enabled|. 60 // the group |data_reduction_proxy_enabled|.
46 void RegisterSyntheticFieldTrial(bool data_reduction_proxy_enabled); 61 void RegisterSyntheticFieldTrial(bool data_reduction_proxy_enabled);
47 62
48 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeSettings); 63 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeSettings);
49 }; 64 };
50 65
51 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ 66 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.cc ('k') | chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698