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

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: don't break windows build 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 0539acc212bc5dcee3ad535f239acc9b35705254..c0fc8529a9bf134541b7d173242c18d1c8cdf896 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_connection_observer.h"
+#endif
#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/services/gcm/gcm_account_tracker.h"
@@ -167,6 +170,11 @@ GCMProfileService::GCMProfileService(
profile_->GetPath().Append(chrome::kGCMStoreDirname),
profile_->GetRequestContext());
+#ifdef CHROMEOS
+ chromeos_connection_observer_.reset(new gcm::ChromeOSGCMConnectionObserver);
+ driver_->AddConnectionObserver(chromeos_connection_observer_.get());
+#endif
+
identity_observer_.reset(new IdentityObserver(
profile, static_cast<gcm::GCMDriverDesktop*>(driver_.get())));
}
@@ -202,6 +210,10 @@ void GCMProfileService::Shutdown() {
#if !defined(OS_ANDROID)
identity_observer_.reset();
#endif // !defined(OS_ANDROID)
+#if defined(OS_CHROMEOS)
+ driver_->RemoveConnectionObserver(chromeos_connection_observer_.get());
+ chromeos_connection_observer_.reset();
+#endif
if (driver_) {
driver_->Shutdown();
« no previous file with comments | « chrome/browser/services/gcm/gcm_profile_service.h ('k') | chrome/browser/services/gcm/gcm_profile_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698