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

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

Issue 10697017: Tabs Extension: Implementation of tabs.duplicate api. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 5 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 }; 59 };
60 const size_t kNumNonPermissionModuleNames = 60 const size_t kNumNonPermissionModuleNames =
61 arraysize(kNonPermissionModuleNames); 61 arraysize(kNonPermissionModuleNames);
62 62
63 // Names of functions (within modules requiring permissions) that can be used 63 // Names of functions (within modules requiring permissions) that can be used
64 // without asking for the module permission. In other words, functions you can 64 // without asking for the module permission. In other words, functions you can
65 // use with no permissions specified. 65 // use with no permissions specified.
66 const char* kNonPermissionFunctionNames[] = { 66 const char* kNonPermissionFunctionNames[] = {
67 "management.getPermissionWarningsByManifest", 67 "management.getPermissionWarningsByManifest",
68 "tabs.create", 68 "tabs.create",
69 "tabs.duplicate",
69 "tabs.onRemoved", 70 "tabs.onRemoved",
70 "tabs.remove", 71 "tabs.remove",
71 "tabs.update", 72 "tabs.update",
72 }; 73 };
73 const size_t kNumNonPermissionFunctionNames = 74 const size_t kNumNonPermissionFunctionNames =
74 arraysize(kNonPermissionFunctionNames); 75 arraysize(kNonPermissionFunctionNames);
75 76
76 const char kOldUnlimitedStoragePermission[] = "unlimited_storage"; 77 const char kOldUnlimitedStoragePermission[] = "unlimited_storage";
77 const char kWindowsPermission[] = "windows"; 78 const char kWindowsPermission[] = "windows";
78 const char kTemporaryBackgroundAlias[] = "background_alias_do_not_use"; 79 const char kTemporaryBackgroundAlias[] = "background_alias_do_not_use";
(...skipping 860 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