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

Side by Side Diff: chrome/common/extensions/permissions/permission_set.cc

Issue 12089037: Add management.uninstallSelf to API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 7 years, 10 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
« no previous file with comments | « chrome/common/extensions/docs/templates/intros/management.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // without asking for the module permission. In other words, functions you can 62 // without asking for the module permission. In other words, functions you can
63 // use with no permissions specified. 63 // use with no permissions specified.
64 const char* kNonPermissionFunctionNames[] = { 64 const char* kNonPermissionFunctionNames[] = {
65 "app.getDetails", 65 "app.getDetails",
66 "app.getDetailsForFrame", 66 "app.getDetailsForFrame",
67 "app.getIsInstalled", 67 "app.getIsInstalled",
68 "app.install", 68 "app.install",
69 "app.installState", 69 "app.installState",
70 "app.runningState", 70 "app.runningState",
71 "management.getPermissionWarningsByManifest", 71 "management.getPermissionWarningsByManifest",
72 "management.uninstallSelf",
72 }; 73 };
73 const size_t kNumNonPermissionFunctionNames = 74 const size_t kNumNonPermissionFunctionNames =
74 arraysize(kNonPermissionFunctionNames); 75 arraysize(kNonPermissionFunctionNames);
75 76
76 void AddPatternsAndRemovePaths(const URLPatternSet& set, URLPatternSet* out) { 77 void AddPatternsAndRemovePaths(const URLPatternSet& set, URLPatternSet* out) {
77 DCHECK(out); 78 DCHECK(out);
78 for (URLPatternSet::const_iterator i = set.begin(); i != set.end(); ++i) { 79 for (URLPatternSet::const_iterator i = set.begin(); i != set.end(); ++i) {
79 URLPattern p = *i; 80 URLPattern p = *i;
80 p.SetPath("/*"); 81 p.SetPath("/*");
81 out->AddPattern(p); 82 out->AddPattern(p);
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 std::set<std::string> new_hosts_only; 607 std::set<std::string> new_hosts_only;
607 608
608 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), 609 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(),
609 old_hosts_set.begin(), old_hosts_set.end(), 610 old_hosts_set.begin(), old_hosts_set.end(),
610 std::inserter(new_hosts_only, new_hosts_only.begin())); 611 std::inserter(new_hosts_only, new_hosts_only.begin()));
611 612
612 return !new_hosts_only.empty(); 613 return !new_hosts_only.empty();
613 } 614 }
614 615
615 } // namespace extensions 616 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/templates/intros/management.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698