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

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

Issue 10436015: Remove chrome.windows.* support for platform apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698