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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 kTopSites, "topSites", IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY, | 255 kTopSites, "topSites", IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY, |
256 ExtensionPermissionMessage::kBrowsingHistory, kFlagNone); | 256 ExtensionPermissionMessage::kBrowsingHistory, kFlagNone); |
257 info->RegisterPermission( | 257 info->RegisterPermission( |
258 kTts, "tts", 0, | 258 kTts, "tts", 0, |
259 ExtensionPermissionMessage::kNone, kFlagCannotBeOptional); | 259 ExtensionPermissionMessage::kNone, kFlagCannotBeOptional); |
260 info->RegisterPermission( | 260 info->RegisterPermission( |
261 kTtsEngine, "ttsEngine", IDS_EXTENSION_PROMPT_WARNING_TTS_ENGINE, | 261 kTtsEngine, "ttsEngine", IDS_EXTENSION_PROMPT_WARNING_TTS_ENGINE, |
262 ExtensionPermissionMessage::kTtsEngine, | 262 ExtensionPermissionMessage::kTtsEngine, |
263 kFlagCannotBeOptional); | 263 kFlagCannotBeOptional); |
264 info->RegisterPermission( | 264 info->RegisterPermission( |
265 kUsb, "usb", IDS_EXTENSION_PROMPT_WARNING_USB, | |
266 ExtensionPermissionMessage::kNone, kFlagNone); | |
Evan Stade
2012/06/12 18:09:48
why is this ExtensionPermissionMessage::kNone?
| |
267 info->RegisterPermission( | |
265 kWebNavigation, "webNavigation", | 268 kWebNavigation, "webNavigation", |
266 IDS_EXTENSION_PROMPT_WARNING_TABS, ExtensionPermissionMessage::kTabs, | 269 IDS_EXTENSION_PROMPT_WARNING_TABS, ExtensionPermissionMessage::kTabs, |
267 kFlagNone); | 270 kFlagNone); |
268 info->RegisterPermission( | 271 info->RegisterPermission( |
269 kWebRequest, "webRequest", 0, ExtensionPermissionMessage::kNone, | 272 kWebRequest, "webRequest", 0, ExtensionPermissionMessage::kNone, |
270 kFlagNone); | 273 kFlagNone); |
271 info->RegisterPermission( | 274 info->RegisterPermission( |
272 kWebRequestBlocking, "webRequestBlocking", 0, | 275 kWebRequestBlocking, "webRequestBlocking", 0, |
273 ExtensionPermissionMessage::kNone, kFlagNone); | 276 ExtensionPermissionMessage::kNone, kFlagNone); |
274 | 277 |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
950 ExtensionOAuth2Scopes current_scopes = scopes(); | 953 ExtensionOAuth2Scopes current_scopes = scopes(); |
951 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); | 954 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); |
952 ExtensionOAuth2Scopes delta_scopes; | 955 ExtensionOAuth2Scopes delta_scopes; |
953 std::set_difference(new_scopes.begin(), new_scopes.end(), | 956 std::set_difference(new_scopes.begin(), new_scopes.end(), |
954 current_scopes.begin(), current_scopes.end(), | 957 current_scopes.begin(), current_scopes.end(), |
955 std::inserter(delta_scopes, delta_scopes.begin())); | 958 std::inserter(delta_scopes, delta_scopes.begin())); |
956 | 959 |
957 // We have less privileges if there are additional scopes present. | 960 // We have less privileges if there are additional scopes present. |
958 return !delta_scopes.empty(); | 961 return !delta_scopes.empty(); |
959 } | 962 } |
OLD | NEW |