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

Side by Side Diff: chrome/browser/extensions/extension_gcm_app_handler.cc

Issue 315573003: Remove PermissionsData::ForExtension() completely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 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/extensions/extension_gcm_app_handler.h" 5 #include "chrome/browser/extensions/extension_gcm_app_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 11 matching lines...) Expand all
22 #endif 22 #endif
23 23
24 namespace extensions { 24 namespace extensions {
25 25
26 namespace { 26 namespace {
27 27
28 base::LazyInstance<BrowserContextKeyedAPIFactory<ExtensionGCMAppHandler> > 28 base::LazyInstance<BrowserContextKeyedAPIFactory<ExtensionGCMAppHandler> >
29 g_factory = LAZY_INSTANCE_INITIALIZER; 29 g_factory = LAZY_INSTANCE_INITIALIZER;
30 30
31 bool IsGCMPermissionEnabled(const Extension* extension) { 31 bool IsGCMPermissionEnabled(const Extension* extension) {
32 return PermissionsData::ForExtension(extension) 32 return extension->permissions_data()->HasAPIPermission(APIPermission::kGcm);
33 ->HasAPIPermission(APIPermission::kGcm);
34 } 33 }
35 34
36 } // namespace 35 } // namespace
37 36
38 37
39 // static 38 // static
40 BrowserContextKeyedAPIFactory<ExtensionGCMAppHandler>* 39 BrowserContextKeyedAPIFactory<ExtensionGCMAppHandler>*
41 ExtensionGCMAppHandler::GetFactoryInstance() { 40 ExtensionGCMAppHandler::GetFactoryInstance() {
42 return g_factory.Pointer(); 41 return g_factory.Pointer();
43 } 42 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 gcm::GCMDriver* ExtensionGCMAppHandler::GetGCMDriver() const { 121 gcm::GCMDriver* ExtensionGCMAppHandler::GetGCMDriver() const {
123 return gcm::GCMProfileServiceFactory::GetForProfile(profile_)->driver(); 122 return gcm::GCMProfileServiceFactory::GetForProfile(profile_)->driver();
124 } 123 }
125 124
126 void ExtensionGCMAppHandler::OnUnregisterCompleted( 125 void ExtensionGCMAppHandler::OnUnregisterCompleted(
127 const std::string& app_id, gcm::GCMClient::Result result) { 126 const std::string& app_id, gcm::GCMClient::Result result) {
128 // Nothing to do. 127 // Nothing to do.
129 } 128 }
130 129
131 } // namespace extensions 130 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/extensions/extension_install_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698