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

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

Issue 10598006: Browser tag shim (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review Created 8 years, 6 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/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // Register hosted and packaged app permissions. 202 // Register hosted and packaged app permissions.
203 { kAppNotifications, "appNotifications" }, 203 { kAppNotifications, "appNotifications" },
204 204
205 // Register extension permissions. 205 // Register extension permissions.
206 { kActiveTab, "activeTab" }, 206 { kActiveTab, "activeTab" },
207 { kAlarms, "alarms" }, 207 { kAlarms, "alarms" },
208 { kAppWindow, "appWindow" }, 208 { kAppWindow, "appWindow" },
209 { kBookmark, "bookmarks", kFlagNone, 209 { kBookmark, "bookmarks", kFlagNone,
210 IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS, 210 IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS,
211 ExtensionPermissionMessage::kBookmarks }, 211 ExtensionPermissionMessage::kBookmarks },
212 { kBrowserTag, "browserTag", kFlagCannotBeOptional },
212 { kBrowsingData, "browsingData" }, 213 { kBrowsingData, "browsingData" },
213 { kContentSettings, "contentSettings", kFlagNone, 214 { kContentSettings, "contentSettings", kFlagNone,
214 IDS_EXTENSION_PROMPT_WARNING_CONTENT_SETTINGS, 215 IDS_EXTENSION_PROMPT_WARNING_CONTENT_SETTINGS,
215 ExtensionPermissionMessage::kContentSettings }, 216 ExtensionPermissionMessage::kContentSettings },
216 { kContextMenus, "contextMenus" }, 217 { kContextMenus, "contextMenus" },
217 { kCookie, "cookies" }, 218 { kCookie, "cookies" },
218 { kFileBrowserHandler, "fileBrowserHandler", kFlagCannotBeOptional }, 219 { kFileBrowserHandler, "fileBrowserHandler", kFlagCannotBeOptional },
219 { kFileSystem, "fileSystem" }, 220 { kFileSystem, "fileSystem" },
220 { kHistory, "history", kFlagNone, 221 { kHistory, "history", kFlagNone,
221 IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY, 222 IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY,
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 ExtensionOAuth2Scopes current_scopes = scopes(); 940 ExtensionOAuth2Scopes current_scopes = scopes();
940 ExtensionOAuth2Scopes new_scopes = permissions->scopes(); 941 ExtensionOAuth2Scopes new_scopes = permissions->scopes();
941 ExtensionOAuth2Scopes delta_scopes; 942 ExtensionOAuth2Scopes delta_scopes;
942 std::set_difference(new_scopes.begin(), new_scopes.end(), 943 std::set_difference(new_scopes.begin(), new_scopes.end(),
943 current_scopes.begin(), current_scopes.end(), 944 current_scopes.begin(), current_scopes.end(),
944 std::inserter(delta_scopes, delta_scopes.begin())); 945 std::inserter(delta_scopes, delta_scopes.begin()));
945 946
946 // We have less privileges if there are additional scopes present. 947 // We have less privileges if there are additional scopes present.
947 return !delta_scopes.empty(); 948 return !delta_scopes.empty();
948 } 949 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698