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

Unified Diff: chrome/browser/services/gcm/gcm_profile_service.cc

Issue 146703006: [GCM] Create and use event router in GCMProfileService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybots Created 6 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 | « chrome/browser/services/gcm/gcm_profile_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/gcm_profile_service.cc
diff --git a/chrome/browser/services/gcm/gcm_profile_service.cc b/chrome/browser/services/gcm/gcm_profile_service.cc
index 971cf0cb4c72a02b2d75a8761016fa2c62ac473c..c280ef87592518776012291b63e1851b785eb140 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service.cc
@@ -9,6 +9,9 @@
#include "base/prefs/pref_service.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/chrome_notification_types.h"
+#if !defined(OS_ANDROID)
+#include "chrome/browser/extensions/api/gcm/gcm_api.h"
+#endif
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/state_store.h"
@@ -486,6 +489,10 @@ void GCMProfileService::Initialize() {
// This has to be done first since CheckIn depends on it.
io_worker_ = new IOWorker(weak_ptr_factory_.GetWeakPtr());
+#if !defined(OS_ANDROID)
+ js_event_router_.reset(new extensions::GcmJsEventRouter(profile_));
+#endif
+
// This initializes GCMClient and also does the check to find out if GCMClient
// has finished the loading.
content::BrowserThread::PostTask(
@@ -922,11 +929,15 @@ void GCMProfileService::GCMClientLoadingFinished() {
DoCheckIn();
}
-GCMEventRouter* GCMProfileService::GetEventRouter(const std::string& app_id) {
+GCMEventRouter* GCMProfileService::GetEventRouter(const std::string& app_id)
+ const {
if (testing_delegate_ && testing_delegate_->GetEventRouter())
return testing_delegate_->GetEventRouter();
- // TODO(fgorski): check and create the event router for JS routing.
+#if defined(OS_ANDROID)
+ return NULL;
+#else
return js_event_router_.get();
+#endif
}
void GCMProfileService::DeleteRegistrationInfo(const std::string& app_id) {
« no previous file with comments | « chrome/browser/services/gcm/gcm_profile_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698