OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/extensions/api/gcm/gcm_api.h" | 5 #include "chrome/browser/extensions/api/gcm/gcm_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 kGoogleRestrictedPrefix) != 0 && | 71 kGoogleRestrictedPrefix) != 0 && |
72 lower.compare(0, | 72 lower.compare(0, |
73 arraysize(kGoogDotRestrictedPrefix), | 73 arraysize(kGoogDotRestrictedPrefix), |
74 kGoogDotRestrictedPrefix) != 0; | 74 kGoogDotRestrictedPrefix) != 0; |
75 } | 75 } |
76 | 76 |
77 } // namespace | 77 } // namespace |
78 | 78 |
79 namespace extensions { | 79 namespace extensions { |
80 | 80 |
81 bool GcmApiFunction::RunImpl() { | 81 bool GcmApiFunction::RunAsync() { |
82 if (!IsGcmApiEnabled()) | 82 if (!IsGcmApiEnabled()) |
83 return false; | 83 return false; |
84 | 84 |
85 return DoWork(); | 85 return DoWork(); |
86 } | 86 } |
87 | 87 |
88 bool GcmApiFunction::IsGcmApiEnabled() const { | 88 bool GcmApiFunction::IsGcmApiEnabled() const { |
89 Profile* profile = Profile::FromBrowserContext(browser_context()); | 89 Profile* profile = Profile::FromBrowserContext(browser_context()); |
90 | 90 |
91 // GCM is not supported in incognito mode. | 91 // GCM is not supported in incognito mode. |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 void GcmJsEventRouter::OnListenerAdded(const EventListenerInfo& details) { | 252 void GcmJsEventRouter::OnListenerAdded(const EventListenerInfo& details) { |
253 if (gcm::GCMProfileService::GetGCMEnabledState(profile_) == | 253 if (gcm::GCMProfileService::GetGCMEnabledState(profile_) == |
254 gcm::GCMProfileService::ALWAYS_DISABLED) { | 254 gcm::GCMProfileService::ALWAYS_DISABLED) { |
255 return; | 255 return; |
256 } | 256 } |
257 gcm::GCMProfileServiceFactory::GetForProfile(profile_)->Start(); | 257 gcm::GCMProfileServiceFactory::GetForProfile(profile_)->Start(); |
258 } | 258 } |
259 | 259 |
260 } // namespace extensions | 260 } // namespace extensions |
OLD | NEW |