| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/services/gcm/gcm_profile_service.h" | 5 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 #else | 162 #else |
| 163 GCMProfileService::GCMProfileService( | 163 GCMProfileService::GCMProfileService( |
| 164 Profile* profile, | 164 Profile* profile, |
| 165 scoped_ptr<GCMClientFactory> gcm_client_factory) | 165 scoped_ptr<GCMClientFactory> gcm_client_factory) |
| 166 : profile_(profile), | 166 : profile_(profile), |
| 167 push_messaging_service_(this, profile) { | 167 push_messaging_service_(this, profile) { |
| 168 DCHECK(!profile->IsOffTheRecord()); | 168 DCHECK(!profile->IsOffTheRecord()); |
| 169 | 169 |
| 170 driver_ = CreateGCMDriverDesktop( | 170 driver_ = CreateGCMDriverDesktop( |
| 171 gcm_client_factory.Pass(), | 171 gcm_client_factory.Pass(), |
| 172 profile_->GetPrefs(), | |
| 173 profile_->GetPath().Append(chrome::kGCMStoreDirname), | 172 profile_->GetPath().Append(chrome::kGCMStoreDirname), |
| 174 profile_->GetRequestContext()); | 173 profile_->GetRequestContext()); |
| 175 | 174 |
| 176 #ifdef CHROMEOS | 175 #ifdef CHROMEOS |
| 177 chromeos_connection_observer_.reset(new gcm::ChromeOSGCMConnectionObserver); | 176 chromeos_connection_observer_.reset(new gcm::ChromeOSGCMConnectionObserver); |
| 178 driver_->AddConnectionObserver(chromeos_connection_observer_.get()); | 177 driver_->AddConnectionObserver(chromeos_connection_observer_.get()); |
| 179 #endif | 178 #endif |
| 180 | 179 |
| 181 identity_observer_.reset(new IdentityObserver( | 180 identity_observer_.reset(new IdentityObserver( |
| 182 profile, static_cast<gcm::GCMDriverDesktop*>(driver_.get()))); | 181 profile, static_cast<gcm::GCMDriverDesktop*>(driver_.get()))); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 return identity_observer_ ? identity_observer_->SignedInUserName() | 230 return identity_observer_ ? identity_observer_->SignedInUserName() |
| 232 : std::string(); | 231 : std::string(); |
| 233 #endif // defined(OS_ANDROID) | 232 #endif // defined(OS_ANDROID) |
| 234 } | 233 } |
| 235 | 234 |
| 236 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { | 235 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { |
| 237 driver_.reset(driver); | 236 driver_.reset(driver); |
| 238 } | 237 } |
| 239 | 238 |
| 240 } // namespace gcm | 239 } // namespace gcm |
| OLD | NEW |