OLD | NEW |
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_EXTENSIONS_API_COMMANDS_EXTENSION_COMMAND_SERVICE_FACTORY
_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_COMMANDS_EXTENSION_COMMAND_SERVICE_FACTORY
_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_COMMANDS_EXTENSION_COMMAND_SERVICE_FACTORY
_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_COMMANDS_EXTENSION_COMMAND_SERVICE_FACTORY
_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "chrome/browser/profiles/profile_keyed_service_factory.h" | 10 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
11 | 11 |
| 12 namespace extensions { |
12 class ExtensionCommandService; | 13 class ExtensionCommandService; |
| 14 } |
| 15 |
| 16 namespace extensions { |
13 | 17 |
14 // Singleton that associate ExtensionCommandService objects with Profiles. | 18 // Singleton that associate ExtensionCommandService objects with Profiles. |
15 class ExtensionCommandServiceFactory : public ProfileKeyedServiceFactory { | 19 class ExtensionCommandServiceFactory : public ProfileKeyedServiceFactory { |
16 public: | 20 public: |
17 static ExtensionCommandService* GetForProfile(Profile* profile); | 21 static ExtensionCommandService* GetForProfile(Profile* profile); |
18 | 22 |
19 static ExtensionCommandServiceFactory* GetInstance(); | 23 static ExtensionCommandServiceFactory* GetInstance(); |
20 | 24 |
21 // Overridden from ProfileKeyedBaseFactory: | 25 // Overridden from ProfileKeyedBaseFactory: |
22 virtual bool ServiceIsCreatedWithProfile() OVERRIDE; | 26 virtual bool ServiceIsCreatedWithProfile() OVERRIDE; |
23 | 27 |
24 private: | 28 private: |
25 friend struct DefaultSingletonTraits<ExtensionCommandServiceFactory>; | 29 friend struct DefaultSingletonTraits<ExtensionCommandServiceFactory>; |
26 | 30 |
27 ExtensionCommandServiceFactory(); | 31 ExtensionCommandServiceFactory(); |
28 virtual ~ExtensionCommandServiceFactory(); | 32 virtual ~ExtensionCommandServiceFactory(); |
29 | 33 |
30 // ProfileKeyedServiceFactory: | 34 // ProfileKeyedServiceFactory: |
31 virtual ProfileKeyedService* BuildServiceInstanceFor( | 35 virtual ProfileKeyedService* BuildServiceInstanceFor( |
32 Profile* profile) const OVERRIDE; | 36 Profile* profile) const OVERRIDE; |
33 virtual bool ServiceRedirectedInIncognito() OVERRIDE; | 37 virtual bool ServiceRedirectedInIncognito() OVERRIDE; |
34 | 38 |
35 DISALLOW_COPY_AND_ASSIGN(ExtensionCommandServiceFactory); | 39 DISALLOW_COPY_AND_ASSIGN(ExtensionCommandServiceFactory); |
36 }; | 40 }; |
37 | 41 |
| 42 } // namespace extensions |
| 43 |
38 #endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_EXTENSION_COMMAND_SERVICE_FACT
ORY_H_ | 44 #endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_EXTENSION_COMMAND_SERVICE_FACT
ORY_H_ |
OLD | NEW |