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

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

Issue 11820041: Remove profile-keyed factory boilerplates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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
Index: chrome/browser/extensions/api/bookmarks/bookmarks_api.h
diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.h b/chrome/browser/extensions/api/bookmarks/bookmarks_api.h
index 0d2a240032dcbe521f903f57f8f51efe6110fba1..6f91e29647f7b769a72c53d248ff206f767a26a0 100644
--- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.h
+++ b/chrome/browser/extensions/api/bookmarks/bookmarks_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,22 +69,33 @@ class BookmarkEventRouter : public BookmarkModelObserver {
DISALLOW_COPY_AND_ASSIGN(BookmarkEventRouter);
};
-class BookmarkAPI : public ProfileKeyedService,
+class BookmarksAPI : public ProfileKeyedAPI,
public EventRouter::Observer {
public:
- explicit BookmarkAPI(Profile* profile);
- virtual ~BookmarkAPI();
+ explicit BookmarksAPI(Profile* profile);
+ virtual ~BookmarksAPI();
// ProfileKeyedService implementation.
virtual void Shutdown() OVERRIDE;
+ // ProfileKeyedAPI implementation.
+ static ProfileKeyedAPIFactory<BookmarksAPI>* GetFactoryInstance();
+
// EventRouter::Observer implementation.
virtual void OnListenerAdded(const EventListenerInfo& details)
OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<BookmarksAPI>;
+
Profile* profile_;
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "BookmarksAPI";
+ }
+ static const bool kServiceIsNULLWhileTesting = true;
+
// Created lazily upon OnListenerAdded.
scoped_ptr<BookmarkEventRouter> bookmark_event_router_;
};

Powered by Google App Engine
This is Rietveld 408576698