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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 kFlagNone); | 230 kFlagNone); |
231 info->RegisterPermission( | 231 info->RegisterPermission( |
232 kKeybinding, "keybinding", 0, | 232 kKeybinding, "keybinding", 0, |
233 ExtensionPermissionMessage::kNone, kFlagNone); | 233 ExtensionPermissionMessage::kNone, kFlagNone); |
234 info->RegisterPermission( | 234 info->RegisterPermission( |
235 kIdle, "idle", 0, ExtensionPermissionMessage::kNone, kFlagNone); | 235 kIdle, "idle", 0, ExtensionPermissionMessage::kNone, kFlagNone); |
236 info->RegisterPermission( | 236 info->RegisterPermission( |
237 kInput, "input", 0, ExtensionPermissionMessage::kNone, | 237 kInput, "input", 0, ExtensionPermissionMessage::kNone, |
238 kFlagImpliesFullURLAccess); | 238 kFlagImpliesFullURLAccess); |
239 info->RegisterPermission( | 239 info->RegisterPermission( |
240 kManagedMode, "managedMode", IDS_EXTENSION_PROMPT_WARNING_MANAGED_MODE, | |
241 ExtensionPermissionMessage::kManagedMode, kFlagNone); | |
242 info->RegisterPermission( | |
243 kManagement, "management", IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT, | 240 kManagement, "management", IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT, |
244 ExtensionPermissionMessage::kManagement, kFlagNone); | 241 ExtensionPermissionMessage::kManagement, kFlagNone); |
245 info->RegisterPermission( | 242 info->RegisterPermission( |
246 kPageCapture, "pageCapture", | 243 kPageCapture, "pageCapture", |
247 IDS_EXTENSION_PROMPT_WARNING_ALL_PAGES_CONTENT, | 244 IDS_EXTENSION_PROMPT_WARNING_ALL_PAGES_CONTENT, |
248 ExtensionPermissionMessage::kAllPageContent, kFlagNone); | 245 ExtensionPermissionMessage::kAllPageContent, kFlagNone); |
249 info->RegisterPermission( | 246 info->RegisterPermission( |
250 kPrivacy, "privacy", IDS_EXTENSION_PROMPT_WARNING_PRIVACY, | 247 kPrivacy, "privacy", IDS_EXTENSION_PROMPT_WARNING_PRIVACY, |
251 ExtensionPermissionMessage::kPrivacy, kFlagNone); | 248 ExtensionPermissionMessage::kPrivacy, kFlagNone); |
252 info->RegisterPermission( | 249 info->RegisterPermission( |
(...skipping 26 matching lines...) Expand all Loading... |
279 // Register private permissions. | 276 // Register private permissions. |
280 info->RegisterPermission( | 277 info->RegisterPermission( |
281 kChromeosInfoPrivate, "chromeosInfoPrivate", 0, | 278 kChromeosInfoPrivate, "chromeosInfoPrivate", 0, |
282 ExtensionPermissionMessage::kNone, | 279 ExtensionPermissionMessage::kNone, |
283 kFlagCannotBeOptional); | 280 kFlagCannotBeOptional); |
284 info->RegisterPermission( | 281 info->RegisterPermission( |
285 kFileBrowserPrivate, "fileBrowserPrivate", 0, | 282 kFileBrowserPrivate, "fileBrowserPrivate", 0, |
286 ExtensionPermissionMessage::kNone, | 283 ExtensionPermissionMessage::kNone, |
287 kFlagCannotBeOptional); | 284 kFlagCannotBeOptional); |
288 info->RegisterPermission( | 285 info->RegisterPermission( |
| 286 kManagedModePrivate, "managedModePrivate", 0, |
| 287 ExtensionPermissionMessage::kNone, kFlagCannotBeOptional); |
| 288 info->RegisterPermission( |
289 kMediaPlayerPrivate, "mediaPlayerPrivate", 0, | 289 kMediaPlayerPrivate, "mediaPlayerPrivate", 0, |
290 ExtensionPermissionMessage::kNone, | 290 ExtensionPermissionMessage::kNone, |
291 kFlagCannotBeOptional); | 291 kFlagCannotBeOptional); |
292 info->RegisterPermission( | 292 info->RegisterPermission( |
293 kMetricsPrivate, "metricsPrivate", 0, | 293 kMetricsPrivate, "metricsPrivate", 0, |
294 ExtensionPermissionMessage::kNone, | 294 ExtensionPermissionMessage::kNone, |
295 kFlagCannotBeOptional); | 295 kFlagCannotBeOptional); |
296 info->RegisterPermission( | 296 info->RegisterPermission( |
297 kSystemPrivate, "systemPrivate", 0, | 297 kSystemPrivate, "systemPrivate", 0, |
298 ExtensionPermissionMessage::kNone, | 298 ExtensionPermissionMessage::kNone, |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 ExtensionOAuth2Scopes current_scopes = scopes(); | 951 ExtensionOAuth2Scopes current_scopes = scopes(); |
952 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); | 952 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); |
953 ExtensionOAuth2Scopes delta_scopes; | 953 ExtensionOAuth2Scopes delta_scopes; |
954 std::set_difference(new_scopes.begin(), new_scopes.end(), | 954 std::set_difference(new_scopes.begin(), new_scopes.end(), |
955 current_scopes.begin(), current_scopes.end(), | 955 current_scopes.begin(), current_scopes.end(), |
956 std::inserter(delta_scopes, delta_scopes.begin())); | 956 std::inserter(delta_scopes, delta_scopes.begin())); |
957 | 957 |
958 // We have less privileges if there are additional scopes present. | 958 // We have less privileges if there are additional scopes present. |
959 return !delta_scopes.empty(); | 959 return !delta_scopes.empty(); |
960 } | 960 } |
OLD | NEW |