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