OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 20 matching lines...) Expand all Loading... |
31 if (a == "net") | 31 if (a == "net") |
32 return b != "com"; | 32 return b != "com"; |
33 if (a == "org") | 33 if (a == "org") |
34 return b != "com" && b != "net"; | 34 return b != "com" && b != "net"; |
35 return false; | 35 return false; |
36 } | 36 } |
37 | 37 |
38 // Names of API modules that can be used without listing it in the | 38 // Names of API modules that can be used without listing it in the |
39 // permissions section of the manifest. | 39 // permissions section of the manifest. |
40 const char* kNonPermissionModuleNames[] = { | 40 const char* kNonPermissionModuleNames[] = { |
41 "browserAction", | |
42 "commands", | |
43 "devtools", | 41 "devtools", |
44 "events", | 42 "events", |
45 "extension", | 43 "extension", |
46 "i18n", | 44 "i18n", |
47 "omnibox", | |
48 "pageAction", | |
49 "pageActions", | |
50 "pageLauncher", | |
51 "permissions", | 45 "permissions", |
52 "runtime", | 46 "runtime", |
53 "scriptBadge", | |
54 "tabs", | 47 "tabs", |
55 "test", | 48 "test", |
56 "types", | 49 "types", |
57 "windows" | 50 "windows" |
58 }; | 51 }; |
59 const size_t kNumNonPermissionModuleNames = | 52 const size_t kNumNonPermissionModuleNames = |
60 arraysize(kNonPermissionModuleNames); | 53 arraysize(kNonPermissionModuleNames); |
61 | 54 |
62 // Names of functions (within modules requiring permissions) that can be used | 55 // Names of functions (within modules requiring permissions) that can be used |
63 // without asking for the module permission. In other words, functions you can | 56 // without asking for the module permission. In other words, functions you can |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 std::set<std::string> new_hosts_only; | 588 std::set<std::string> new_hosts_only; |
596 | 589 |
597 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), | 590 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), |
598 old_hosts_set.begin(), old_hosts_set.end(), | 591 old_hosts_set.begin(), old_hosts_set.end(), |
599 std::inserter(new_hosts_only, new_hosts_only.begin())); | 592 std::inserter(new_hosts_only, new_hosts_only.begin())); |
600 | 593 |
601 return !new_hosts_only.empty(); | 594 return !new_hosts_only.empty(); |
602 } | 595 } |
603 | 596 |
604 } // namespace extensions | 597 } // namespace extensions |
OLD | NEW |