| 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 27 matching lines...) Expand all Loading... |
| 38 return b != "com" && b != "net"; | 38 return b != "com" && b != "net"; |
| 39 return false; | 39 return false; |
| 40 } | 40 } |
| 41 | 41 |
| 42 // Names of API modules that can be used without listing it in the | 42 // Names of API modules that can be used without listing it in the |
| 43 // permissions section of the manifest. | 43 // permissions section of the manifest. |
| 44 const char* kNonPermissionModuleNames[] = { | 44 const char* kNonPermissionModuleNames[] = { |
| 45 "app", | 45 "app", |
| 46 "browserAction", | 46 "browserAction", |
| 47 "devtools", | 47 "devtools", |
| 48 "events", |
| 48 "extension", | 49 "extension", |
| 49 "i18n", | 50 "i18n", |
| 50 "omnibox", | 51 "omnibox", |
| 51 "pageAction", | 52 "pageAction", |
| 52 "pageActions", | 53 "pageActions", |
| 53 "permissions", | 54 "permissions", |
| 54 "test", | 55 "test", |
| 55 "types" | 56 "types" |
| 56 }; | 57 }; |
| 57 const size_t kNumNonPermissionModuleNames = | 58 const size_t kNumNonPermissionModuleNames = |
| (...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 ExtensionOAuth2Scopes current_scopes = scopes(); | 963 ExtensionOAuth2Scopes current_scopes = scopes(); |
| 963 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); | 964 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); |
| 964 ExtensionOAuth2Scopes delta_scopes; | 965 ExtensionOAuth2Scopes delta_scopes; |
| 965 std::set_difference(new_scopes.begin(), new_scopes.end(), | 966 std::set_difference(new_scopes.begin(), new_scopes.end(), |
| 966 current_scopes.begin(), current_scopes.end(), | 967 current_scopes.begin(), current_scopes.end(), |
| 967 std::inserter(delta_scopes, delta_scopes.begin())); | 968 std::inserter(delta_scopes, delta_scopes.begin())); |
| 968 | 969 |
| 969 // We have less privileges if there are additional scopes present. | 970 // We have less privileges if there are additional scopes present. |
| 970 return !delta_scopes.empty(); | 971 return !delta_scopes.empty(); |
| 971 } | 972 } |
| OLD | NEW |