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

Side by Side Diff: chrome/common/extensions/permissions/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, 4 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/permissions/permission_set.h" 5 #include "chrome/common/extensions/permissions/permission_set.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <string> 9 #include <string>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 }; 52 };
53 const size_t kNumNonPermissionModuleNames = 53 const size_t kNumNonPermissionModuleNames =
54 arraysize(kNonPermissionModuleNames); 54 arraysize(kNonPermissionModuleNames);
55 55
56 // Names of functions (within modules requiring permissions) that can be used 56 // Names of functions (within modules requiring permissions) that can be used
57 // without asking for the module permission. In other words, functions you can 57 // without asking for the module permission. In other words, functions you can
58 // use with no permissions specified. 58 // use with no permissions specified.
59 const char* kNonPermissionFunctionNames[] = { 59 const char* kNonPermissionFunctionNames[] = {
60 "management.getPermissionWarningsByManifest", 60 "management.getPermissionWarningsByManifest",
61 "tabs.create", 61 "tabs.create",
62 "tabs.duplicate",
62 "tabs.onRemoved", 63 "tabs.onRemoved",
63 "tabs.remove", 64 "tabs.remove",
64 "tabs.update", 65 "tabs.update",
65 }; 66 };
66 const size_t kNumNonPermissionFunctionNames = 67 const size_t kNumNonPermissionFunctionNames =
67 arraysize(kNonPermissionFunctionNames); 68 arraysize(kNonPermissionFunctionNames);
68 69
69 void AddPatternsAndRemovePaths(const URLPatternSet& set, URLPatternSet* out) { 70 void AddPatternsAndRemovePaths(const URLPatternSet& set, URLPatternSet* out) {
70 DCHECK(out); 71 DCHECK(out);
71 for (URLPatternSet::const_iterator i = set.begin(); i != set.end(); ++i) { 72 for (URLPatternSet::const_iterator i = set.begin(); i != set.end(); ++i) {
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 std::set<std::string> new_hosts_only; 592 std::set<std::string> new_hosts_only;
592 593
593 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), 594 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(),
594 old_hosts_set.begin(), old_hosts_set.end(), 595 old_hosts_set.begin(), old_hosts_set.end(),
595 std::inserter(new_hosts_only, new_hosts_only.begin())); 596 std::inserter(new_hosts_only, new_hosts_only.begin()));
596 597
597 return !new_hosts_only.empty(); 598 return !new_hosts_only.empty();
598 } 599 }
599 600
600 } // namespace extensions 601 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698