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

Side by Side Diff: chrome/browser/services/gcm/gcm_profile_service.cc

Issue 561943002: Reland: Add GCMChannelStatusSyncer to schedule requests and enable/disable GCM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CrOS test failures 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/services/gcm/gcm_desktop_utils.cc ('k') | components/gcm_driver.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/services/gcm/gcm_desktop_utils.cc ('k') | components/gcm_driver.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698