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 "extensions/common/permissions/extensions_api_permissions.h" | 5 #include "extensions/common/permissions/extensions_api_permissions.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "extensions/common/manifest_constants.h" |
14 #include "extensions/common/permissions/api_permission.h" | 15 #include "extensions/common/permissions/api_permission.h" |
15 #include "extensions/common/permissions/socket_permission.h" | 16 #include "extensions/common/permissions/socket_permission.h" |
16 #include "extensions/common/permissions/usb_device_permission.h" | 17 #include "extensions/common/permissions/usb_device_permission.h" |
17 #include "extensions/strings/grit/extensions_strings.h" | 18 #include "extensions/strings/grit/extensions_strings.h" |
18 | 19 |
19 namespace extensions { | 20 namespace extensions { |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 template <typename T> | 24 template <typename T> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 {APIPermission::kVpnProvider, "vpnProvider", | 96 {APIPermission::kVpnProvider, "vpnProvider", |
96 APIPermissionInfo::kFlagCannotBeOptional}, | 97 APIPermissionInfo::kFlagCannotBeOptional}, |
97 // NOTE(kalman): This is provided by a manifest property but needs to | 98 // NOTE(kalman): This is provided by a manifest property but needs to |
98 // appear in the install permission dialogue, so we need a fake | 99 // appear in the install permission dialogue, so we need a fake |
99 // permission for it. See http://crbug.com/247857. | 100 // permission for it. See http://crbug.com/247857. |
100 {APIPermission::kWebConnectable, "webConnectable", | 101 {APIPermission::kWebConnectable, "webConnectable", |
101 APIPermissionInfo::kFlagCannotBeOptional | | 102 APIPermissionInfo::kFlagCannotBeOptional | |
102 APIPermissionInfo::kFlagInternal}, | 103 APIPermissionInfo::kFlagInternal}, |
103 {APIPermission::kWebRequest, "webRequest"}, | 104 {APIPermission::kWebRequest, "webRequest"}, |
104 {APIPermission::kWebRequestBlocking, "webRequestBlocking"}, | 105 {APIPermission::kWebRequestBlocking, "webRequestBlocking"}, |
| 106 // TODO see if permission system is "complete"? |
| 107 {APIPermission::kDeclarativeNetRequest, |
| 108 manifest_values::kDeclarativeNetRequest}, |
105 {APIPermission::kWebView, "webview", | 109 {APIPermission::kWebView, "webview", |
106 APIPermissionInfo::kFlagCannotBeOptional}, | 110 APIPermissionInfo::kFlagCannotBeOptional}, |
107 {APIPermission::kWindowShape, "app.window.shape"}, | 111 {APIPermission::kWindowShape, "app.window.shape"}, |
108 }; | 112 }; |
109 | 113 |
110 std::vector<std::unique_ptr<APIPermissionInfo>> permissions; | 114 std::vector<std::unique_ptr<APIPermissionInfo>> permissions; |
111 | 115 |
112 for (size_t i = 0; i < arraysize(permissions_to_register); ++i) | 116 for (size_t i = 0; i < arraysize(permissions_to_register); ++i) |
113 permissions.push_back( | 117 permissions.push_back( |
114 base::WrapUnique(new APIPermissionInfo(permissions_to_register[i]))); | 118 base::WrapUnique(new APIPermissionInfo(permissions_to_register[i]))); |
115 return permissions; | 119 return permissions; |
116 } | 120 } |
117 | 121 |
118 } // namespace extensions | 122 } // namespace extensions |
OLD | NEW |