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/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 ExtensionPermissionMessage::ID message_id; | 185 ExtensionPermissionMessage::ID message_id; |
186 } PermissionsToRegister[] = { | 186 } PermissionsToRegister[] = { |
187 // Register permissions for all extension types. | 187 // Register permissions for all extension types. |
188 { kBackground, "background" }, | 188 { kBackground, "background" }, |
189 { kClipboardRead, "clipboardRead", kFlagNone, | 189 { kClipboardRead, "clipboardRead", kFlagNone, |
190 IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD, | 190 IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD, |
191 ExtensionPermissionMessage::kClipboard }, | 191 ExtensionPermissionMessage::kClipboard }, |
192 { kClipboardWrite, "clipboardWrite" }, | 192 { kClipboardWrite, "clipboardWrite" }, |
193 { kDeclarative, "declarative" }, | 193 { kDeclarative, "declarative" }, |
194 { kDeclarativeWebRequest, "declarativeWebRequest" }, | 194 { kDeclarativeWebRequest, "declarativeWebRequest" }, |
| 195 { kDownloads, "downloads", kFlagNone, |
| 196 IDS_EXTENSION_PROMPT_WARNING_DOWNLOADS, |
| 197 ExtensionPermissionMessage::kDownloads }, |
195 { kExperimental, "experimental", kFlagCannotBeOptional }, | 198 { kExperimental, "experimental", kFlagCannotBeOptional }, |
196 { kGeolocation, "geolocation", kFlagCannotBeOptional, | 199 { kGeolocation, "geolocation", kFlagCannotBeOptional, |
197 IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION, | 200 IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION, |
198 ExtensionPermissionMessage::kGeolocation }, | 201 ExtensionPermissionMessage::kGeolocation }, |
199 { kNotification, "notifications" }, | 202 { kNotification, "notifications" }, |
200 { kUnlimitedStorage, "unlimitedStorage", kFlagCannotBeOptional }, | 203 { kUnlimitedStorage, "unlimitedStorage", kFlagCannotBeOptional }, |
201 | 204 |
202 // Register hosted and packaged app permissions. | 205 // Register hosted and packaged app permissions. |
203 { kAppNotifications, "appNotifications" }, | 206 { kAppNotifications, "appNotifications" }, |
204 | 207 |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 ExtensionOAuth2Scopes current_scopes = scopes(); | 942 ExtensionOAuth2Scopes current_scopes = scopes(); |
940 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); | 943 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); |
941 ExtensionOAuth2Scopes delta_scopes; | 944 ExtensionOAuth2Scopes delta_scopes; |
942 std::set_difference(new_scopes.begin(), new_scopes.end(), | 945 std::set_difference(new_scopes.begin(), new_scopes.end(), |
943 current_scopes.begin(), current_scopes.end(), | 946 current_scopes.begin(), current_scopes.end(), |
944 std::inserter(delta_scopes, delta_scopes.begin())); | 947 std::inserter(delta_scopes, delta_scopes.begin())); |
945 | 948 |
946 // We have less privileges if there are additional scopes present. | 949 // We have less privileges if there are additional scopes present. |
947 return !delta_scopes.empty(); | 950 return !delta_scopes.empty(); |
948 } | 951 } |
OLD | NEW |