OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_ENTRY_WATCHER_SERVICE_FACTORY_
H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_ENTRY_WATCHER_SERVICE_FACTORY_
H_ |
| 7 |
| 8 #include "base/memory/singleton.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 |
| 11 namespace content { |
| 12 class BrowserContext; |
| 13 } // namespace content |
| 14 |
| 15 namespace extensions { |
| 16 |
| 17 class EntryWatcherService; |
| 18 |
| 19 // Creates instances of the EntryWatcherService class. |
| 20 class EntryWatcherServiceFactory : public BrowserContextKeyedServiceFactory { |
| 21 public: |
| 22 // Returns a service instance singleton per |context|, after creating it |
| 23 // (if necessary). |
| 24 static EntryWatcherService* Get(content::BrowserContext* context); |
| 25 |
| 26 // Returns a service instance for the context if exists. Otherwise, returns |
| 27 // NULL. |
| 28 static EntryWatcherService* FindExisting(content::BrowserContext* context); |
| 29 |
| 30 // Gets a singleton instance of the factory. |
| 31 static EntryWatcherServiceFactory* GetInstance(); |
| 32 |
| 33 private: |
| 34 friend struct DefaultSingletonTraits<EntryWatcherServiceFactory>; |
| 35 |
| 36 EntryWatcherServiceFactory(); |
| 37 virtual ~EntryWatcherServiceFactory(); |
| 38 |
| 39 // BrowserContextKeyedServiceFactory overrides: |
| 40 virtual KeyedService* BuildServiceInstanceFor( |
| 41 content::BrowserContext* profile) const OVERRIDE; |
| 42 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(EntryWatcherServiceFactory); |
| 45 }; |
| 46 |
| 47 } // namespace extensions |
| 48 |
| 49 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_ENTRY_WATCHER_SERVICE_FACTO
RY_H_ |
OLD | NEW |