Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: chrome/browser/extensions/api/idle/idle_manager_factory.h

Issue 826933003: Update idle extension API to use BrowserContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make BrowserContext members const Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698