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

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs_windows_api.h

Issue 174513003: Move ProfileKeyedAPI implementations to take BrowserContext in the constructor (part 3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
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_TABS_TABS_WINDOWS_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" 9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
10 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" 10 #include "components/browser_context_keyed_service/browser_context_keyed_service .h"
11 #include "extensions/browser/event_router.h" 11 #include "extensions/browser/event_router.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 class TabsEventRouter; 14 class TabsEventRouter;
15 class WindowsEventRouter; 15 class WindowsEventRouter;
16 16
17 class TabsWindowsAPI : public ProfileKeyedAPI, public EventRouter::Observer { 17 class TabsWindowsAPI : public ProfileKeyedAPI, public EventRouter::Observer {
18 public: 18 public:
19 explicit TabsWindowsAPI(Profile* profile); 19 explicit TabsWindowsAPI(content::BrowserContext* context);
20 virtual ~TabsWindowsAPI(); 20 virtual ~TabsWindowsAPI();
21 21
22 // Convenience method to get the TabsWindowsAPI for a profile. 22 // Convenience method to get the TabsWindowsAPI for a profile.
23 static TabsWindowsAPI* Get(Profile* profile); 23 static TabsWindowsAPI* Get(content::BrowserContext* context);
24 24
25 TabsEventRouter* tabs_event_router(); 25 TabsEventRouter* tabs_event_router();
26 WindowsEventRouter* windows_event_router(); 26 WindowsEventRouter* windows_event_router();
27 27
28 // BrowserContextKeyedService implementation. 28 // BrowserContextKeyedService implementation.
29 virtual void Shutdown() OVERRIDE; 29 virtual void Shutdown() OVERRIDE;
30 30
31 // ProfileKeyedAPI implementation. 31 // ProfileKeyedAPI implementation.
32 static ProfileKeyedAPIFactory<TabsWindowsAPI>* GetFactoryInstance(); 32 static ProfileKeyedAPIFactory<TabsWindowsAPI>* GetFactoryInstance();
33 33
34 // EventRouter::Observer implementation. 34 // EventRouter::Observer implementation.
35 virtual void OnListenerAdded(const extensions::EventListenerInfo& details) 35 virtual void OnListenerAdded(const extensions::EventListenerInfo& details)
36 OVERRIDE; 36 OVERRIDE;
37 37
38 private: 38 private:
39 friend class ProfileKeyedAPIFactory<TabsWindowsAPI>; 39 friend class ProfileKeyedAPIFactory<TabsWindowsAPI>;
40 40
41 Profile* profile_; 41 content::BrowserContext* browser_context_;
42 42
43 // ProfileKeyedAPI implementation. 43 // ProfileKeyedAPI implementation.
44 static const char* service_name() { 44 static const char* service_name() {
45 return "TabsWindowsAPI"; 45 return "TabsWindowsAPI";
46 } 46 }
47 static const bool kServiceIsNULLWhileTesting = true; 47 static const bool kServiceIsNULLWhileTesting = true;
48 48
49 scoped_ptr<TabsEventRouter> tabs_event_router_; 49 scoped_ptr<TabsEventRouter> tabs_event_router_;
50 scoped_ptr<WindowsEventRouter> windows_event_router_; 50 scoped_ptr<WindowsEventRouter> windows_event_router_;
51 }; 51 };
52 52
53 } // namespace extensions 53 } // namespace extensions
54 54
55 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_ 55 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698