Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / net / spdyproxy / data_reduction_proxy_chrome_settings_factory.cc
blob33fcb4237d046d911407576cf20846218dffa799
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"
7 #include "base/bind.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"
13 // static
14 DataReductionProxyChromeSettings*
15 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(
16 content::BrowserContext* context) {
17 return static_cast<DataReductionProxyChromeSettings*>(
18 GetInstance()->GetServiceForBrowserContext(context, true));
21 // static
22 bool
23 DataReductionProxyChromeSettingsFactory::HasDataReductionProxyChromeSettings(
24 content::BrowserContext* context) {
25 return GetInstance()->GetServiceForBrowserContext(context, false) != NULL;
28 // static
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();