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

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

Issue 15091002: Lazily load API schemas from resource files and convert all APIs to features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more comments and fixed tests Created 7 years, 6 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) 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
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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 std::set<std::string> new_hosts_only; 593 std::set<std::string> new_hosts_only;
601 594
602 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), 595 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(),
603 old_hosts_set.begin(), old_hosts_set.end(), 596 old_hosts_set.begin(), old_hosts_set.end(),
604 std::inserter(new_hosts_only, new_hosts_only.begin())); 597 std::inserter(new_hosts_only, new_hosts_only.begin()));
605 598
606 return !new_hosts_only.empty(); 599 return !new_hosts_only.empty();
607 } 600 }
608 601
609 } // namespace extensions 602 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698