| 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 0223cbeef2b1e2e72ffe9dce4f48c987ce5821b8..0de6385d77b6fe0d6f1fa820c404316e224569b5 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"
|
| @@ -170,6 +173,11 @@ GCMProfileService::GCMProfileService(
|
| profile_->GetPath().Append(chrome::kGCMStoreDirname),
|
| profile_->GetRequestContext());
|
|
|
| +#if defined(OS_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())));
|
| }
|
| @@ -205,8 +213,11 @@ void GCMProfileService::Shutdown() {
|
| #if !defined(OS_ANDROID)
|
| identity_observer_.reset();
|
| #endif // !defined(OS_ANDROID)
|
| -
|
| if (driver_) {
|
| +#if defined(OS_CHROMEOS)
|
| + driver_->RemoveConnectionObserver(chromeos_connection_observer_.get());
|
| + chromeos_connection_observer_.reset();
|
| +#endif
|
| driver_->Shutdown();
|
| driver_.reset();
|
| }
|
|
|