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

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: version 2, no traits 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..3e66b5f869e0e8bd0c7c6b8a3b164a8956ae55d1 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,8 +32,16 @@ class TabsWindowsAPI : public ProfileKeyedService,
OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<TabsWindowsAPI>;
+
Profile* profile_;
+ static const char* service_name() {
Jeffrey Yasskin 2012/12/22 00:16:04 Possibly comment this as "ProfileKeyedAPI implemen
Yoyo Zhou 2012/12/26 17:46:33 Done.
+ return "TabsWindowsAPI";
+ }
+
+ static const bool kServiceIsNULLWhileTesting = true;
+
scoped_ptr<WindowsEventRouter> windows_event_router_;
};

Powered by Google App Engine
This is Rietveld 408576698