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_IDLE_IDLE_MANAGER_FACTORY_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IDLE_IDLE_MANAGER_FACTORY_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_API_IDLE_IDLE_MANAGER_FACTORY_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_IDLE_IDLE_MANAGER_FACTORY_H__ |
7 | 7 |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
10 | 10 |
11 class Profile; | 11 namespace content { |
| 12 class BrowserContext; |
| 13 } // namespace content |
12 | 14 |
13 namespace extensions { | 15 namespace extensions { |
14 class IdleManager; | 16 class IdleManager; |
15 | 17 |
16 class IdleManagerFactory : public BrowserContextKeyedServiceFactory { | 18 class IdleManagerFactory : public BrowserContextKeyedServiceFactory { |
17 public: | 19 public: |
18 static IdleManager* GetForProfile(Profile* profile); | 20 static IdleManager* GetForBrowserContext(content::BrowserContext* context); |
19 | 21 |
20 static IdleManagerFactory* GetInstance(); | 22 static IdleManagerFactory* GetInstance(); |
21 | 23 |
22 private: | 24 private: |
23 friend struct DefaultSingletonTraits<IdleManagerFactory>; | 25 friend struct DefaultSingletonTraits<IdleManagerFactory>; |
24 | 26 |
25 IdleManagerFactory(); | 27 IdleManagerFactory(); |
26 ~IdleManagerFactory() override; | 28 ~IdleManagerFactory() override; |
27 | 29 |
28 // BrowserContextKeyedBaseFactory implementation. | 30 // BrowserContextKeyedBaseFactory implementation. |
29 KeyedService* BuildServiceInstanceFor( | 31 KeyedService* BuildServiceInstanceFor( |
30 content::BrowserContext* profile) const override; | 32 content::BrowserContext* context) const override; |
31 content::BrowserContext* GetBrowserContextToUse( | 33 content::BrowserContext* GetBrowserContextToUse( |
32 content::BrowserContext* context) const override; | 34 content::BrowserContext* context) const override; |
33 bool ServiceIsCreatedWithBrowserContext() const override; | 35 bool ServiceIsCreatedWithBrowserContext() const override; |
34 bool ServiceIsNULLWhileTesting() const override; | 36 bool ServiceIsNULLWhileTesting() const override; |
35 }; | 37 }; |
36 | 38 |
37 } // namespace extensions | 39 } // namespace extensions |
38 | 40 |
39 #endif // CHROME_BROWSER_EXTENSIONS_API_IDLE_IDLE_MANAGER_FACTORY_H__ | 41 #endif // CHROME_BROWSER_EXTENSIONS_API_IDLE_IDLE_MANAGER_FACTORY_H__ |
OLD | NEW |