OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |