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 "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "extensions/browser/extension_system.h" | 22 #include "extensions/browser/extension_system.h" |
23 #include "extensions/common/extension.h" | 23 #include "extensions/common/extension.h" |
24 #include "extensions/common/permissions/permissions_data.h" | 24 #include "extensions/common/permissions/permissions_data.h" |
25 | 25 |
26 namespace extensions { | 26 namespace extensions { |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 const char kDummyAppId[] = "extension.guard.dummy.id"; | 30 const char kDummyAppId[] = "extension.guard.dummy.id"; |
31 | 31 |
32 base::LazyInstance<BrowserContextKeyedAPIFactory<ExtensionGCMAppHandler> > | 32 base::LazyInstance<BrowserContextKeyedAPIFactory<ExtensionGCMAppHandler>>:: |
33 g_factory = LAZY_INSTANCE_INITIALIZER; | 33 DestructorAtExit g_factory = LAZY_INSTANCE_INITIALIZER; |
34 | 34 |
35 bool IsGCMPermissionEnabled(const Extension* extension) { | 35 bool IsGCMPermissionEnabled(const Extension* extension) { |
36 return extension->permissions_data()->HasAPIPermission(APIPermission::kGcm); | 36 return extension->permissions_data()->HasAPIPermission(APIPermission::kGcm); |
37 } | 37 } |
38 | 38 |
39 } // namespace | 39 } // namespace |
40 | 40 |
41 | 41 |
42 // static | 42 // static |
43 BrowserContextKeyedAPIFactory<ExtensionGCMAppHandler>* | 43 BrowserContextKeyedAPIFactory<ExtensionGCMAppHandler>* |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 void ExtensionGCMAppHandler::AddAppHandler(const std::string& app_id) { | 199 void ExtensionGCMAppHandler::AddAppHandler(const std::string& app_id) { |
200 GetGCMDriver()->AddAppHandler(app_id, this); | 200 GetGCMDriver()->AddAppHandler(app_id, this); |
201 } | 201 } |
202 | 202 |
203 void ExtensionGCMAppHandler::RemoveAppHandler(const std::string& app_id) { | 203 void ExtensionGCMAppHandler::RemoveAppHandler(const std::string& app_id) { |
204 GetGCMDriver()->RemoveAppHandler(app_id); | 204 GetGCMDriver()->RemoveAppHandler(app_id); |
205 } | 205 } |
206 | 206 |
207 } // namespace extensions | 207 } // namespace extensions |
OLD | NEW |