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

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

Issue 409883006: GCM: D-Bus methods for wake-on-packet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes from review, plus change to dbus protocol Created 6 years, 3 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/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 4b90897c225bdbe7a0c968f8dbc0ab25815af527..aa757895cddd628a086dbd7afcfbc6ed0bf3727e 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service.cc
@@ -16,6 +16,9 @@
#include "components/gcm_driver/gcm_driver_android.h"
#else
#include "base/bind.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/services/gcm/chromeos_gcm_app_handler.h"
+#endif
#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/services/gcm/gcm_account_tracker.h"
@@ -35,6 +38,8 @@
namespace gcm {
+const char kGCMChromeOSAppHandlerId[] = "com.google.chrome.chromeos";
+
#if !defined(OS_ANDROID)
// Identity observer only has actual work to do when the user is actually signed
// in. It ensures that account tracker is taking
@@ -165,6 +170,11 @@ GCMProfileService::GCMProfileService(
profile_->GetPath().Append(chrome::kGCMStoreDirname),
profile_->GetRequestContext());
+#ifdef CHROMEOS
+ chromeos_app_handler_.reset(new gcm::ChromeOSGCMAppHandler);
+ driver_->AddAppHandler(kGCMChromeOSAppHandlerId, chromeos_app_handler_.get());
+#endif
+
identity_observer_.reset(new IdentityObserver(
profile, static_cast<gcm::GCMDriverDesktop*>(driver_.get())));
}
@@ -205,6 +215,9 @@ void GCMProfileService::Shutdown() {
driver_->Shutdown();
driver_.reset();
}
+#ifdef CHROMEOS
+ driver_->RemoveAppHandler(kGCMChromeOSAppHandlerId);
+#endif
}
std::string GCMProfileService::SignedInUserName() const {

Powered by Google App Engine
This is Rietveld 408576698