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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |