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

Side by Side Diff: chrome/browser/gcm/instance_id/instance_id_profile_service.cc

Issue 2847923002: [Chromecast] Add method to CastCdm for the session expiration updating. (Closed)
Patch Set: Add InstanceIDFactory class to help with testing. Created 3 years, 5 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 | « no previous file | components/gcm_driver/gcm_profile_service.h » ('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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/gcm/instance_id/instance_id_profile_service.h" 5 #include "chrome/browser/gcm/instance_id/instance_id_profile_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/gcm/gcm_profile_service_factory.h" 8 #include "chrome/browser/gcm/gcm_profile_service_factory.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "components/gcm_driver/gcm_profile_service.h" 10 #include "components/gcm_driver/gcm_profile_service.h"
11 #include "components/gcm_driver/instance_id/instance_id_driver.h" 11 #include "components/gcm_driver/instance_id/instance_id_driver.h"
12 12
13 namespace instance_id { 13 namespace instance_id {
14 14
15 // static 15 // static
16 bool InstanceIDProfileService::IsInstanceIDEnabled(Profile* profile) { 16 bool InstanceIDProfileService::IsInstanceIDEnabled(Profile* profile) {
17 // Instance ID depends on GCM which has to been enabled. 17 // Instance ID depends on GCM which has to been enabled.
18 if (!gcm::GCMProfileService::IsGCMEnabled(profile->GetPrefs())) 18 if (!gcm::GCMProfileService::IsGCMEnabled(profile->GetPrefs()))
19 return false; 19 return false;
20 20
21 return InstanceIDDriver::IsInstanceIDEnabled(); 21 return InstanceIDDriver::IsInstanceIDEnabled();
22 } 22 }
23 23
24 InstanceIDProfileService::InstanceIDProfileService(Profile* profile) { 24 InstanceIDProfileService::InstanceIDProfileService(Profile* profile) {
25 DCHECK(!profile->IsOffTheRecord()); 25 DCHECK(!profile->IsOffTheRecord());
26 26
27 driver_.reset(new InstanceIDDriver( 27 gcm::GCMProfileService* profile_service =
28 gcm::GCMProfileServiceFactory::GetForProfile(profile)->driver())); 28 gcm::GCMProfileServiceFactory::GetForProfile(profile);
29 driver_.reset(new InstanceIDDriver(profile_service->driver(),
30 profile_service->instance_id_factory()));
29 } 31 }
30 32
31 InstanceIDProfileService::~InstanceIDProfileService() { 33 InstanceIDProfileService::~InstanceIDProfileService() {
32 } 34 }
33 35
34 } // namespace instance_id 36 } // namespace instance_id
OLDNEW
« no previous file with comments | « no previous file | components/gcm_driver/gcm_profile_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698