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

Unified Diff: chrome/browser/extensions/api/bookmarks/bookmark_api.h

Issue 11820041: Remove profile-keyed factory boilerplates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bookmarks/bookmark_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/bookmarks/bookmark_api.h
diff --git a/chrome/browser/extensions/api/bookmarks/bookmark_api.h b/chrome/browser/extensions/api/bookmarks/bookmark_api.h
index c3008246dccba0ace995025dcbf9ac7d16d71f63..902467a7a07c2c0b55d00c051a93ad21f20393a2 100644
--- a/chrome/browser/extensions/api/bookmarks/bookmark_api.h
+++ b/chrome/browser/extensions/api/bookmarks/bookmark_api.h
@@ -12,9 +12,9 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "chrome/browser/bookmarks/bookmark_model_observer.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/extensions/extension_function.h"
-#include "chrome/browser/profiles/profile_keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/base/dialogs/select_file_dialog.h"
@@ -69,7 +69,7 @@ class BookmarkEventRouter : public BookmarkModelObserver {
DISALLOW_COPY_AND_ASSIGN(BookmarkEventRouter);
};
-class BookmarkAPI : public ProfileKeyedService,
+class BookmarkAPI : public ProfileKeyedAPI,
public EventRouter::Observer {
public:
explicit BookmarkAPI(Profile* profile);
@@ -78,13 +78,24 @@ class BookmarkAPI : public ProfileKeyedService,
// ProfileKeyedService implementation.
virtual void Shutdown() OVERRIDE;
+ // ProfileKeyedAPI implementation.
+ static ProfileKeyedAPIFactory<BookmarkAPI>* GetFactoryInstance();
+
// EventRouter::Observer implementation.
virtual void OnListenerAdded(const EventListenerInfo& details)
OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<BookmarkAPI>;
+
Profile* profile_;
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "BookmarkAPI";
+ }
+ static const bool kServiceIsNULLWhileTesting = true;
+
// Created lazily upon OnListenerAdded.
scoped_ptr<BookmarkEventRouter> bookmark_event_router_;
};
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bookmarks/bookmark_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698