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
3 // found in the LICENSE file.
5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.h"
8 #include "base/memory/singleton.h"
9 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
14 DataReductionProxyChromeSettings
*
15 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(
16 content::BrowserContext
* context
) {
17 return static_cast<DataReductionProxyChromeSettings
*>(
18 GetInstance()->GetServiceForBrowserContext(context
, true));
23 DataReductionProxyChromeSettingsFactory::HasDataReductionProxyChromeSettings(
24 content::BrowserContext
* context
) {
25 return GetInstance()->GetServiceForBrowserContext(context
, false) != NULL
;
29 DataReductionProxyChromeSettingsFactory
*
30 DataReductionProxyChromeSettingsFactory::GetInstance() {
31 return Singleton
<DataReductionProxyChromeSettingsFactory
>::get();
35 DataReductionProxyChromeSettingsFactory::
36 DataReductionProxyChromeSettingsFactory()
37 : BrowserContextKeyedServiceFactory(
38 "DataReductionProxyChromeSettings",
39 BrowserContextDependencyManager::GetInstance()) {
42 DataReductionProxyChromeSettingsFactory::
43 ~DataReductionProxyChromeSettingsFactory() {
46 KeyedService
* DataReductionProxyChromeSettingsFactory::BuildServiceInstanceFor(
47 content::BrowserContext
* context
) const {
48 return new DataReductionProxyChromeSettings();