| 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 ExtensionPermissionMessage::kFullAccess, kFlagImpliesFullURLAccess | | 354 ExtensionPermissionMessage::kFullAccess, kFlagImpliesFullURLAccess | |
| 355 kFlagImpliesFullAccess | kFlagCannotBeOptional); | 355 kFlagImpliesFullAccess | kFlagCannotBeOptional); |
| 356 | 356 |
| 357 // Platform-app permissions. | 357 // Platform-app permissions. |
| 358 info->RegisterPermission( | 358 info->RegisterPermission( |
| 359 kSocket, "socket", 0, ExtensionPermissionMessage::kNone, | 359 kSocket, "socket", 0, ExtensionPermissionMessage::kNone, |
| 360 kFlagCannotBeOptional); | 360 kFlagCannotBeOptional); |
| 361 | 361 |
| 362 // Register aliases. | 362 // Register aliases. |
| 363 info->RegisterAlias("unlimitedStorage", kOldUnlimitedStoragePermission); | 363 info->RegisterAlias("unlimitedStorage", kOldUnlimitedStoragePermission); |
| 364 // TODO(mihaip): Remove this alias for platform apps, and only give them | |
| 365 // access to the chrome.windows.* APIs, but not the chrome.tabs.* ones. | |
| 366 info->RegisterAlias("tabs", kWindowsPermission); | 364 info->RegisterAlias("tabs", kWindowsPermission); |
| 367 // TODO(mihaip): Should be removed for the M20 branch, see | 365 // TODO(mihaip): Should be removed for the M20 branch, see |
| 368 // http://crbug.com/120447 for more details. | 366 // http://crbug.com/120447 for more details. |
| 369 info->RegisterAlias("background", kTemporaryBackgroundAlias); | 367 info->RegisterAlias("background", kTemporaryBackgroundAlias); |
| 370 | 368 |
| 371 } | 369 } |
| 372 | 370 |
| 373 // | 371 // |
| 374 // ExtensionPermissionsInfo | 372 // ExtensionPermissionsInfo |
| 375 // | 373 // |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 ExtensionOAuth2Scopes current_scopes = scopes(); | 965 ExtensionOAuth2Scopes current_scopes = scopes(); |
| 968 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); | 966 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); |
| 969 ExtensionOAuth2Scopes delta_scopes; | 967 ExtensionOAuth2Scopes delta_scopes; |
| 970 std::set_difference(new_scopes.begin(), new_scopes.end(), | 968 std::set_difference(new_scopes.begin(), new_scopes.end(), |
| 971 current_scopes.begin(), current_scopes.end(), | 969 current_scopes.begin(), current_scopes.end(), |
| 972 std::inserter(delta_scopes, delta_scopes.begin())); | 970 std::inserter(delta_scopes, delta_scopes.begin())); |
| 973 | 971 |
| 974 // We have less privileges if there are additional scopes present. | 972 // We have less privileges if there are additional scopes present. |
| 975 return !delta_scopes.empty(); | 973 return !delta_scopes.empty(); |
| 976 } | 974 } |
| OLD | NEW |