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_FILE_SYSTEM_ENTRY_WATCHER_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_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 class EntryWatcherService; |
| 16 |
| 17 // Creates instances of the EntryWatcherService class. |
| 18 class EntryWatcherServiceFactory : public BrowserContextKeyedServiceFactory { |
| 19 public: |
| 20 // Returns a service instance singleton per |context|, after creating it |
| 21 // (if necessary). |
| 22 static EntryWatcherService* Get(content::BrowserContext* context); |
| 23 |
| 24 // Returns a service instance for the context if exists. Otherwise, returns |
| 25 // NULL. |
| 26 static EntryWatcherService* FindExisting(content::BrowserContext* context); |
| 27 |
| 28 // Gets a singleton instance of the factory. |
| 29 static EntryWatcherServiceFactory* GetInstance(); |
| 30 |
| 31 private: |
| 32 friend struct DefaultSingletonTraits<EntryWatcherServiceFactory>; |
| 33 |
| 34 EntryWatcherServiceFactory(); |
| 35 virtual ~EntryWatcherServiceFactory(); |
| 36 |
| 37 // BrowserContextKeyedServiceFactory overrides: |
| 38 virtual KeyedService* BuildServiceInstanceFor( |
| 39 content::BrowserContext* profile) const OVERRIDE; |
| 40 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(EntryWatcherServiceFactory); |
| 43 }; |
| 44 |
| 45 #endif // CHROME_BROWSER_FILE_SYSTEM_ENTRY_WATCHER_SERVICE_FACTORY_H_ |
OLD | NEW |