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 "chrome/browser/invalidation/ticl_profile_settings_provider.h" | 5 #include "chrome/browser/invalidation/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" | 10 #include "base/prefs/pref_service.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Do not try to use GCM channel if GCM is disabled. | 36 // Do not try to use GCM channel if GCM is disabled. |
37 return false; | 37 return false; |
38 } | 38 } |
39 | 39 |
40 if (profile_->GetPrefs()->GetBoolean( | 40 if (profile_->GetPrefs()->GetBoolean( |
41 prefs::kInvalidationServiceUseGCMChannel)) { | 41 prefs::kInvalidationServiceUseGCMChannel)) { |
42 // Use GCM channel if it was enabled via prefs. | 42 // Use GCM channel if it was enabled via prefs. |
43 return true; | 43 return true; |
44 } | 44 } |
45 | 45 |
46 if (CommandLine::ForCurrentProcess()->HasSwitch( | 46 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
47 switches::kInvalidationUseGCMChannel)) { | 47 switches::kInvalidationUseGCMChannel)) { |
48 // Use GCM channel if it was enabled via a command-line switch. | 48 // Use GCM channel if it was enabled via a command-line switch. |
49 return true; | 49 return true; |
50 } | 50 } |
51 | 51 |
52 // By default, do not use GCM channel. | 52 // By default, do not use GCM channel. |
53 return false; | 53 return false; |
54 } | 54 } |
55 | 55 |
56 } // namespace invalidation | 56 } // namespace invalidation |
OLD | NEW |