Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: chrome/common/extensions/extension_permission_set.cc

Issue 10257006: Move Declarative Web Request API out of experimental and make it a feature (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 info->RegisterPermission( 178 info->RegisterPermission(
179 kBackground, "background", 0, 179 kBackground, "background", 0,
180 ExtensionPermissionMessage::kNone, kFlagNone); 180 ExtensionPermissionMessage::kNone, kFlagNone);
181 info->RegisterPermission( 181 info->RegisterPermission(
182 kClipboardRead, "clipboardRead", IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD, 182 kClipboardRead, "clipboardRead", IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD,
183 ExtensionPermissionMessage::kClipboard, kFlagNone); 183 ExtensionPermissionMessage::kClipboard, kFlagNone);
184 info->RegisterPermission( 184 info->RegisterPermission(
185 kClipboardWrite, "clipboardWrite", 0, 185 kClipboardWrite, "clipboardWrite", 0,
186 ExtensionPermissionMessage::kNone, kFlagNone); 186 ExtensionPermissionMessage::kNone, kFlagNone);
187 info->RegisterPermission( 187 info->RegisterPermission(
188 kDeclarative, "declarative", 0,
189 ExtensionPermissionMessage::kNone, kFlagNone);
190 info->RegisterPermission(
191 kDeclarativeWebRequest, "declarativeWebRequest", 0,
192 ExtensionPermissionMessage::kNone, kFlagNone);
193 info->RegisterPermission(
188 kExperimental, "experimental", 0, 194 kExperimental, "experimental", 0,
189 ExtensionPermissionMessage::kNone, kFlagCannotBeOptional); 195 ExtensionPermissionMessage::kNone, kFlagCannotBeOptional);
190 info->RegisterPermission( 196 info->RegisterPermission(
191 kGeolocation, "geolocation", IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION, 197 kGeolocation, "geolocation", IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION,
192 ExtensionPermissionMessage::kGeolocation, 198 ExtensionPermissionMessage::kGeolocation,
193 kFlagCannotBeOptional); 199 kFlagCannotBeOptional);
194 info->RegisterPermission( 200 info->RegisterPermission(
195 kNotification, "notifications", 0, 201 kNotification, "notifications", 0,
196 ExtensionPermissionMessage::kNone, kFlagNone); 202 ExtensionPermissionMessage::kNone, kFlagNone);
197 info->RegisterPermission( 203 info->RegisterPermission(
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 ExtensionOAuth2Scopes current_scopes = scopes(); 962 ExtensionOAuth2Scopes current_scopes = scopes();
957 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); 963 ExtensionOAuth2Scopes new_scopes = permissions->scopes();
958 ExtensionOAuth2Scopes delta_scopes; 964 ExtensionOAuth2Scopes delta_scopes;
959 std::set_difference(new_scopes.begin(), new_scopes.end(), 965 std::set_difference(new_scopes.begin(), new_scopes.end(),
960 current_scopes.begin(), current_scopes.end(), 966 current_scopes.begin(), current_scopes.end(),
961 std::inserter(delta_scopes, delta_scopes.begin())); 967 std::inserter(delta_scopes, delta_scopes.begin()));
962 968
963 // We have less privileges if there are additional scopes present. 969 // We have less privileges if there are additional scopes present.
964 return !delta_scopes.empty(); 970 return !delta_scopes.empty();
965 } 971 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_permission_set.h ('k') | chrome/common/extensions/extension_permission_set_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698