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

Unified 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: jyasskin's 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/tabs/tabs_windows_api.h
diff --git a/chrome/browser/extensions/api/tabs/tabs_windows_api.h b/chrome/browser/extensions/api/tabs/tabs_windows_api.h
index ae24d5c8b34a4dd7e8907810a69af5b6d90cede2..b3fa9f5437ca2e4eddd2bb5d2e48ba6070c775fa 100644
--- a/chrome/browser/extensions/api/tabs/tabs_windows_api.h
+++ b/chrome/browser/extensions/api/tabs/tabs_windows_api.h
@@ -6,13 +6,14 @@
#define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_
#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
namespace extensions {
class WindowsEventRouter;
-class TabsWindowsAPI : public ProfileKeyedService,
+class TabsWindowsAPI : public ProfileKeyedAPI,
public extensions::EventRouter::Observer {
public:
explicit TabsWindowsAPI(Profile* profile);
@@ -31,11 +32,23 @@ class TabsWindowsAPI : public ProfileKeyedService,
OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<TabsWindowsAPI>;
+
Profile* profile_;
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "TabsWindowsAPI";
+ }
+ static const bool kServiceIsNULLWhileTesting = true;
+
scoped_ptr<WindowsEventRouter> windows_event_router_;
};
+template <>
+ProfileKeyedAPIFactory<TabsWindowsAPI>*
+ProfileKeyedAPIFactory<TabsWindowsAPI>::GetInstance();
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_
« no previous file with comments | « chrome/browser/extensions/api/profile_keyed_api_factory.h ('k') | chrome/browser/extensions/api/tabs/tabs_windows_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698