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

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

Issue 11649053: Banish boilerplate. Profile-keyed API factory for extension API classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/event_router.h" 10 #include "chrome/browser/extensions/event_router.h"
10 #include "chrome/browser/profiles/profile_keyed_service.h" 11 #include "chrome/browser/profiles/profile_keyed_service.h"
11 12
12 namespace extensions { 13 namespace extensions {
13 class WindowsEventRouter; 14 class WindowsEventRouter;
14 15
15 class TabsWindowsAPI : public ProfileKeyedService, 16 class TabsWindowsAPI : public ProfileKeyedService,
16 public extensions::EventRouter::Observer { 17 public extensions::EventRouter::Observer {
17 public: 18 public:
18 explicit TabsWindowsAPI(Profile* profile); 19 explicit TabsWindowsAPI(Profile* profile);
(...skipping 10 matching lines...) Expand all
29 // EventRouter::Observer implementation. 30 // EventRouter::Observer implementation.
30 virtual void OnListenerAdded(const extensions::EventListenerInfo& details) 31 virtual void OnListenerAdded(const extensions::EventListenerInfo& details)
31 OVERRIDE; 32 OVERRIDE;
32 33
33 private: 34 private:
34 Profile* profile_; 35 Profile* profile_;
35 36
36 scoped_ptr<WindowsEventRouter> windows_event_router_; 37 scoped_ptr<WindowsEventRouter> windows_event_router_;
37 }; 38 };
38 39
40 template <>
41 struct ProfileKeyedAPIFactoryTraits<TabsWindowsAPI>
42 : public DefaultProfileKeyedAPIFactoryTraits {
43 static const char* name() {
44 return "TabsWindowsAPI";
45 }
46
47 static const bool kServiceIsNULLWhileTesting = true;
48 };
49
39 } // namespace extensions 50 } // namespace extensions
40 51
41 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_ 52 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698