| 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_EXTENSION_COMMAND_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_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 class ExtensionCommandService; |
| 13 |
| 14 // Singleton that owns all ExtensionCommandService and associates them with |
| 15 // Profiles. Listens for the Profile's destruction notification and cleans up |
| 16 // the associated ExtensionCommandService. |
| 17 class ExtensionCommandServiceFactory : public ProfileKeyedServiceFactory { |
| 18 public: |
| 19 static ExtensionCommandService* GetForProfile(Profile* profile); |
| 20 |
| 21 static ExtensionCommandServiceFactory* GetInstance(); |
| 22 |
| 23 // Overridden from ProfileKeyedBaseFactory: |
| 24 virtual bool ServiceIsCreatedWithProfile() OVERRIDE; |
| 25 |
| 26 private: |
| 27 friend struct DefaultSingletonTraits<ExtensionCommandServiceFactory>; |
| 28 |
| 29 ExtensionCommandServiceFactory(); |
| 30 virtual ~ExtensionCommandServiceFactory(); |
| 31 |
| 32 // ProfileKeyedServiceFactory: |
| 33 virtual ProfileKeyedService* BuildServiceInstanceFor( |
| 34 Profile* profile) const OVERRIDE; |
| 35 virtual bool ServiceRedirectedInIncognito() OVERRIDE; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(ExtensionCommandServiceFactory); |
| 38 }; |
| 39 |
| 40 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMAND_SERVICE_FACTORY_H_ |
| OLD | NEW |