OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/extensions/extension_permission_set.h" | 5 #include "chrome/common/extensions/extension_permission_set.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 info->RegisterPermission( | 186 info->RegisterPermission( |
187 kClipboardWrite, "clipboardWrite", 0, | 187 kClipboardWrite, "clipboardWrite", 0, |
188 ExtensionPermissionMessage::kNone, kFlagNone); | 188 ExtensionPermissionMessage::kNone, kFlagNone); |
189 info->RegisterPermission( | 189 info->RegisterPermission( |
190 kDeclarative, "declarative", 0, | 190 kDeclarative, "declarative", 0, |
191 ExtensionPermissionMessage::kNone, kFlagNone); | 191 ExtensionPermissionMessage::kNone, kFlagNone); |
192 info->RegisterPermission( | 192 info->RegisterPermission( |
193 kDeclarativeWebRequest, "declarativeWebRequest", 0, | 193 kDeclarativeWebRequest, "declarativeWebRequest", 0, |
194 ExtensionPermissionMessage::kNone, kFlagNone); | 194 ExtensionPermissionMessage::kNone, kFlagNone); |
195 info->RegisterPermission( | 195 info->RegisterPermission( |
| 196 kDownloads, "downloads", IDS_EXTENSION_PROMPT_WARNING_DOWNLOADS, |
| 197 ExtensionPermissionMessage::kDownloads, kFlagNone); |
| 198 info->RegisterPermission( |
196 kExperimental, "experimental", 0, | 199 kExperimental, "experimental", 0, |
197 ExtensionPermissionMessage::kNone, kFlagCannotBeOptional); | 200 ExtensionPermissionMessage::kNone, kFlagCannotBeOptional); |
198 info->RegisterPermission( | 201 info->RegisterPermission( |
199 kGeolocation, "geolocation", IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION, | 202 kGeolocation, "geolocation", IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION, |
200 ExtensionPermissionMessage::kGeolocation, | 203 ExtensionPermissionMessage::kGeolocation, |
201 kFlagCannotBeOptional); | 204 kFlagCannotBeOptional); |
202 info->RegisterPermission( | 205 info->RegisterPermission( |
203 kNotification, "notifications", 0, | 206 kNotification, "notifications", 0, |
204 ExtensionPermissionMessage::kNone, kFlagNone); | 207 ExtensionPermissionMessage::kNone, kFlagNone); |
205 info->RegisterPermission( | 208 info->RegisterPermission( |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 ExtensionOAuth2Scopes current_scopes = scopes(); | 981 ExtensionOAuth2Scopes current_scopes = scopes(); |
979 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); | 982 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); |
980 ExtensionOAuth2Scopes delta_scopes; | 983 ExtensionOAuth2Scopes delta_scopes; |
981 std::set_difference(new_scopes.begin(), new_scopes.end(), | 984 std::set_difference(new_scopes.begin(), new_scopes.end(), |
982 current_scopes.begin(), current_scopes.end(), | 985 current_scopes.begin(), current_scopes.end(), |
983 std::inserter(delta_scopes, delta_scopes.begin())); | 986 std::inserter(delta_scopes, delta_scopes.begin())); |
984 | 987 |
985 // We have less privileges if there are additional scopes present. | 988 // We have less privileges if there are additional scopes present. |
986 return !delta_scopes.empty(); | 989 return !delta_scopes.empty(); |
987 } | 990 } |
OLD | NEW |