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

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

Issue 17911005: Merge 208347 "Revert 208315 "Make use of InvalidationService"" (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1547/src/
Patch Set: Created 7 years, 6 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.cc
===================================================================
--- chrome/browser/extensions/api/push_messaging/push_messaging_api.cc (revision 208727)
+++ chrome/browser/extensions/api/push_messaging/push_messaging_api.cc (working copy)
@@ -19,11 +19,11 @@
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/extensions/token_cache/token_cache_service.h"
#include "chrome/browser/extensions/token_cache/token_cache_service_factory.h"
-#include "chrome/browser/invalidation/invalidation_service.h"
-#include "chrome/browser/invalidation/invalidation_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/token_service.h"
#include "chrome/browser/signin/token_service_factory.h"
+#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/api/push_messaging.h"
@@ -302,18 +302,17 @@
void PushMessagingAPI::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- invalidation::InvalidationService* invalidation_service =
- invalidation::InvalidationServiceFactory::GetForProfile(profile_);
+ ProfileSyncService* pss = ProfileSyncServiceFactory::GetForProfile(profile_);
// This may be NULL; for example, for the ChromeOS guest user. In these cases,
// just return without setting up anything, since it won't work anyway.
- if (!invalidation_service)
+ if (!pss)
return;
if (!event_router_)
event_router_.reset(new PushMessagingEventRouter(profile_));
if (!handler_) {
handler_.reset(new PushMessagingInvalidationHandler(
- invalidation_service, event_router_.get()));
+ pss, event_router_.get()));
}
switch (type) {
case chrome::NOTIFICATION_EXTENSION_INSTALLED: {
@@ -352,7 +351,7 @@
template <>
void ProfileKeyedAPIFactory<PushMessagingAPI>::DeclareFactoryDependencies() {
DependsOn(ExtensionSystemFactory::GetInstance());
- DependsOn(invalidation::InvalidationServiceFactory::GetInstance());
+ DependsOn(ProfileSyncServiceFactory::GetInstance());
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698