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

Unified Diff: chrome/browser/extensions/api/history/history_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/history/history_api.h
diff --git a/chrome/browser/extensions/api/history/history_api.h b/chrome/browser/extensions/api/history/history_api.h
index 9700b1823eb3c9dd6ff9af58073790a53536a33a..9692dba545e84bc4a65d1a3b1c929101682ed637 100644
--- a/chrome/browser/extensions/api/history/history_api.h
+++ b/chrome/browser/extensions/api/history/history_api.h
@@ -10,11 +10,11 @@
#include "base/compiler_specific.h"
#include "base/memory/linked_ptr.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/history/history.h"
#include "chrome/browser/history/history_notifications.h"
-#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/common/cancelable_task_tracker.h"
#include "chrome/common/extensions/api/history.h"
#include "content/public/browser/notification_registrar.h"
@@ -54,7 +54,7 @@ class HistoryEventRouter : public content::NotificationObserver {
DISALLOW_COPY_AND_ASSIGN(HistoryEventRouter);
};
-class HistoryAPI : public ProfileKeyedService,
+class HistoryAPI : public ProfileKeyedAPI,
public EventRouter::Observer {
public:
explicit HistoryAPI(Profile* profile);
@@ -63,12 +63,23 @@ class HistoryAPI : public ProfileKeyedService,
// ProfileKeyedService implementation.
virtual void Shutdown() OVERRIDE;
+ // ProfileKeyedAPI implementation.
+ static ProfileKeyedAPIFactory<HistoryAPI>* GetFactoryInstance();
+
// EventRouter::Observer implementation.
virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<HistoryAPI>;
+
Profile* profile_;
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "HistoryAPI";
+ }
+ static const bool kServiceIsNULLWhileTesting = true;
+
// Created lazily upon OnListenerAdded.
scoped_ptr<HistoryEventRouter> history_event_router_;
};

Powered by Google App Engine
This is Rietveld 408576698