| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEGATE
_FACTORY_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEGATE
_FACTORY_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEGATE
_FACTORY_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEGATE
_FACTORY_H__ |
| 7 | 7 |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 | 10 |
| 11 namespace context { | 11 namespace context { |
| 12 class BrowserContext; | 12 class BrowserContext; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 class SettingsPrivateDelegate; | 16 class SettingsPrivateDelegate; |
| 17 | 17 |
| 18 // BrowserContextKeyedServiceFactory for each SettingsPrivateDelegate. | 18 // BrowserContextKeyedServiceFactory for each SettingsPrivateDelegate. |
| 19 class SettingsPrivateDelegateFactory | 19 class SettingsPrivateDelegateFactory |
| 20 : public BrowserContextKeyedServiceFactory { | 20 : public BrowserContextKeyedServiceFactory { |
| 21 public: | 21 public: |
| 22 static SettingsPrivateDelegate* GetForBrowserContext( | 22 static SettingsPrivateDelegate* GetForBrowserContext( |
| 23 content::BrowserContext* browser_context); | 23 content::BrowserContext* browser_context); |
| 24 | 24 |
| 25 static SettingsPrivateDelegateFactory* GetInstance(); | 25 static SettingsPrivateDelegateFactory* GetInstance(); |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 friend struct DefaultSingletonTraits<SettingsPrivateDelegateFactory>; | 28 friend struct base::DefaultSingletonTraits<SettingsPrivateDelegateFactory>; |
| 29 | 29 |
| 30 SettingsPrivateDelegateFactory(); | 30 SettingsPrivateDelegateFactory(); |
| 31 ~SettingsPrivateDelegateFactory() override; | 31 ~SettingsPrivateDelegateFactory() override; |
| 32 | 32 |
| 33 // BrowserContextKeyedBaseFactory implementation. | 33 // BrowserContextKeyedBaseFactory implementation. |
| 34 KeyedService* BuildServiceInstanceFor( | 34 KeyedService* BuildServiceInstanceFor( |
| 35 content::BrowserContext* profile) const override; | 35 content::BrowserContext* profile) const override; |
| 36 | 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateDelegateFactory); | 37 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateDelegateFactory); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace extensions | 40 } // namespace extensions |
| 41 | 41 |
| 42 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEG
ATE_FACTORY_H__ | 42 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEG
ATE_FACTORY_H__ |
| OLD | NEW |