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

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

Issue 309533007: Refactor PermissionsData pt1 (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::HasAPIPermission(extension, APIPermission::kGcm); 32 return PermissionsData::ForExtension(extension)
33 ->HasAPIPermission(APIPermission::kGcm);
33 } 34 }
34 35
35 } // namespace 36 } // namespace
36 37
37 38
38 // static 39 // static
39 BrowserContextKeyedAPIFactory<ExtensionGCMAppHandler>* 40 BrowserContextKeyedAPIFactory<ExtensionGCMAppHandler>*
40 ExtensionGCMAppHandler::GetFactoryInstance() { 41 ExtensionGCMAppHandler::GetFactoryInstance() {
41 return g_factory.Pointer(); 42 return g_factory.Pointer();
42 } 43 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 gcm::GCMDriver* ExtensionGCMAppHandler::GetGCMDriver() const { 122 gcm::GCMDriver* ExtensionGCMAppHandler::GetGCMDriver() const {
122 return gcm::GCMProfileServiceFactory::GetForProfile(profile_)->driver(); 123 return gcm::GCMProfileServiceFactory::GetForProfile(profile_)->driver();
123 } 124 }
124 125
125 void ExtensionGCMAppHandler::OnUnregisterCompleted( 126 void ExtensionGCMAppHandler::OnUnregisterCompleted(
126 const std::string& app_id, gcm::GCMClient::Result result) { 127 const std::string& app_id, gcm::GCMClient::Result result) {
127 // Nothing to do. 128 // Nothing to do.
128 } 129 }
129 130
130 } // namespace extensions 131 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698