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

Side by Side Diff: chrome/browser/extensions/api/gcm/gcm_api.cc

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/gcm/gcm_api.h ('k') | chrome/browser/extensions/api/history/history_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698