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

Unified Diff: chrome/browser/extensions/api/push_messaging/push_messaging_api.h

Issue 11682005: Remove some Profile-keyed factory boilerplate: management omnibox preference push_messaging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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/push_messaging/push_messaging_api.h
diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h
index d8b95929077cf30fc57bc3bd22d31b0f234f7956..3afef2de0429665904995e393b5942e4b8430467 100644
--- a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h
@@ -11,10 +11,10 @@
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "chrome/browser/extensions/api/push_messaging/obfuscated_gaia_id_fetcher.h"
#include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler_delegate.h"
#include "chrome/browser/extensions/extension_function.h"
-#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -103,7 +103,7 @@ class PushMessagingGetChannelIdFunction
DISALLOW_COPY_AND_ASSIGN(PushMessagingGetChannelIdFunction);
};
-class PushMessagingAPI : public ProfileKeyedService {
+class PushMessagingAPI : public ProfileKeyedAPI {
public:
explicit PushMessagingAPI(Profile* profile);
virtual ~PushMessagingAPI();
@@ -114,16 +114,31 @@ class PushMessagingAPI : public ProfileKeyedService {
// ProfileKeyedService implementation.
virtual void Shutdown() OVERRIDE;
+ // ProfileKeyedAPI implementation.
+ static ProfileKeyedAPIFactory<PushMessagingAPI>* GetFactoryInstance();
+
// For testing purposes.
PushMessagingEventRouter* GetEventRouterForTest();
private:
+ friend class ProfileKeyedAPIFactory<PushMessagingAPI>;
+
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "PushMessagingAPI";
+ }
+ static const bool kServiceIsCreatedWithProfile = false;
+ static const bool kServiceIsNULLWhileTesting = true;
+
// Created at ExtensionService startup.
scoped_ptr<PushMessagingEventRouter> push_messaging_event_router_;
DISALLOW_COPY_AND_ASSIGN(PushMessagingAPI);
};
-} // namespace extension
+template <>
+void ProfileKeyedAPIFactory<PushMessagingAPI>::DeclareFactoryDependencies();
+
+} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__

Powered by Google App Engine
This is Rietveld 408576698