OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/invalidation/impl/ticl_profile_settings_provider.h" | 5 #include "components/invalidation/impl/ticl_profile_settings_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | |
11 #include "components/gcm_driver/gcm_channel_status_syncer.h" | 10 #include "components/gcm_driver/gcm_channel_status_syncer.h" |
12 #include "components/invalidation/impl/invalidation_prefs.h" | 11 #include "components/invalidation/impl/invalidation_prefs.h" |
13 #include "components/invalidation/impl/invalidation_switches.h" | 12 #include "components/invalidation/impl/invalidation_switches.h" |
14 #include "components/pref_registry/pref_registry_syncable.h" | 13 #include "components/pref_registry/pref_registry_syncable.h" |
| 14 #include "components/prefs/pref_service.h" |
15 | 15 |
16 namespace invalidation { | 16 namespace invalidation { |
17 | 17 |
18 TiclProfileSettingsProvider::TiclProfileSettingsProvider(PrefService* prefs) | 18 TiclProfileSettingsProvider::TiclProfileSettingsProvider(PrefService* prefs) |
19 : prefs_(prefs) { | 19 : prefs_(prefs) { |
20 registrar_.Init(prefs_); | 20 registrar_.Init(prefs_); |
21 registrar_.Add( | 21 registrar_.Add( |
22 prefs::kInvalidationServiceUseGCMChannel, | 22 prefs::kInvalidationServiceUseGCMChannel, |
23 base::Bind(&TiclProfileSettingsProvider::FireOnUseGCMChannelChanged, | 23 base::Bind(&TiclProfileSettingsProvider::FireOnUseGCMChannelChanged, |
24 base::Unretained(this))); | 24 base::Unretained(this))); |
(...skipping 15 matching lines...) Expand all Loading... |
40 switches::kInvalidationUseGCMChannel)) { | 40 switches::kInvalidationUseGCMChannel)) { |
41 // Use GCM channel if it was enabled via a command-line switch. | 41 // Use GCM channel if it was enabled via a command-line switch. |
42 return true; | 42 return true; |
43 } | 43 } |
44 | 44 |
45 // By default, do not use GCM channel. | 45 // By default, do not use GCM channel. |
46 return false; | 46 return false; |
47 } | 47 } |
48 | 48 |
49 } // namespace invalidation | 49 } // namespace invalidation |
OLD | NEW |