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(), |
172 profile_->GetPath().Append(chrome::kGCMStoreDirname), | 173 profile_->GetPath().Append(chrome::kGCMStoreDirname), |
173 profile_->GetRequestContext()); | 174 profile_->GetRequestContext()); |
174 | 175 |
175 #ifdef CHROMEOS | 176 #ifdef CHROMEOS |
176 chromeos_connection_observer_.reset(new gcm::ChromeOSGCMConnectionObserver); | 177 chromeos_connection_observer_.reset(new gcm::ChromeOSGCMConnectionObserver); |
177 driver_->AddConnectionObserver(chromeos_connection_observer_.get()); | 178 driver_->AddConnectionObserver(chromeos_connection_observer_.get()); |
178 #endif | 179 #endif |
179 | 180 |
180 identity_observer_.reset(new IdentityObserver( | 181 identity_observer_.reset(new IdentityObserver( |
181 profile, static_cast<gcm::GCMDriverDesktop*>(driver_.get()))); | 182 profile, static_cast<gcm::GCMDriverDesktop*>(driver_.get()))); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 return identity_observer_ ? identity_observer_->SignedInUserName() | 231 return identity_observer_ ? identity_observer_->SignedInUserName() |
231 : std::string(); | 232 : std::string(); |
232 #endif // defined(OS_ANDROID) | 233 #endif // defined(OS_ANDROID) |
233 } | 234 } |
234 | 235 |
235 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { | 236 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { |
236 driver_.reset(driver); | 237 driver_.reset(driver); |
237 } | 238 } |
238 | 239 |
239 } // namespace gcm | 240 } // namespace gcm |
OLD | NEW |