| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 #else | 157 #else |
| 158 GCMProfileService::GCMProfileService( | 158 GCMProfileService::GCMProfileService( |
| 159 Profile* profile, | 159 Profile* profile, |
| 160 scoped_ptr<GCMClientFactory> gcm_client_factory) | 160 scoped_ptr<GCMClientFactory> gcm_client_factory) |
| 161 : profile_(profile), | 161 : profile_(profile), |
| 162 push_messaging_service_(this, profile) { | 162 push_messaging_service_(this, profile) { |
| 163 DCHECK(!profile->IsOffTheRecord()); | 163 DCHECK(!profile->IsOffTheRecord()); |
| 164 | 164 |
| 165 driver_ = CreateGCMDriverDesktop( | 165 driver_ = CreateGCMDriverDesktop( |
| 166 gcm_client_factory.Pass(), | 166 gcm_client_factory.Pass(), |
| 167 profile_->GetPrefs(), |
| 167 profile_->GetPath().Append(chrome::kGCMStoreDirname), | 168 profile_->GetPath().Append(chrome::kGCMStoreDirname), |
| 168 profile_->GetRequestContext()); | 169 profile_->GetRequestContext()); |
| 169 | 170 |
| 170 identity_observer_.reset(new IdentityObserver( | 171 identity_observer_.reset(new IdentityObserver( |
| 171 profile, static_cast<gcm::GCMDriverDesktop*>(driver_.get()))); | 172 profile, static_cast<gcm::GCMDriverDesktop*>(driver_.get()))); |
| 172 } | 173 } |
| 173 #endif // defined(OS_ANDROID) | 174 #endif // defined(OS_ANDROID) |
| 174 | 175 |
| 175 GCMProfileService::GCMProfileService() | 176 GCMProfileService::GCMProfileService() |
| 176 : profile_(NULL), | 177 : profile_(NULL), |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 return identity_observer_ ? identity_observer_->SignedInUserName() | 217 return identity_observer_ ? identity_observer_->SignedInUserName() |
| 217 : std::string(); | 218 : std::string(); |
| 218 #endif // defined(OS_ANDROID) | 219 #endif // defined(OS_ANDROID) |
| 219 } | 220 } |
| 220 | 221 |
| 221 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { | 222 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { |
| 222 driver_.reset(driver); | 223 driver_.reset(driver); |
| 223 } | 224 } |
| 224 | 225 |
| 225 } // namespace gcm | 226 } // namespace gcm |
| OLD | NEW |