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/manifest.h" | 5 #include "chrome/common/extensions/manifest.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 // Everything except themes and platform apps. | 65 // Everything except themes and platform apps. |
66 map[keys::kPlugins] = all_but_themes - Manifest::kTypePlatformApp; | 66 map[keys::kPlugins] = all_but_themes - Manifest::kTypePlatformApp; |
67 | 67 |
68 // Extensions and packaged apps. | 68 // Extensions and packaged apps. |
69 int ext_and_packaged = | 69 int ext_and_packaged = |
70 Manifest::kTypeExtension | Manifest::kTypePackagedApp; | 70 Manifest::kTypeExtension | Manifest::kTypePackagedApp; |
71 map[keys::kContentScripts] = ext_and_packaged; | 71 map[keys::kContentScripts] = ext_and_packaged; |
72 map[keys::kOmnibox] = ext_and_packaged; | 72 map[keys::kOmnibox] = ext_and_packaged; |
73 map[keys::kDevToolsPage] = ext_and_packaged; | 73 map[keys::kDevToolsPage] = ext_and_packaged; |
74 map[keys::kSidebar] = ext_and_packaged; | |
75 map[keys::kHomepageURL] = ext_and_packaged; | 74 map[keys::kHomepageURL] = ext_and_packaged; |
76 map[keys::kChromeURLOverrides] = ext_and_packaged; | 75 map[keys::kChromeURLOverrides] = ext_and_packaged; |
77 map[keys::kInputComponents] = ext_and_packaged; | 76 map[keys::kInputComponents] = ext_and_packaged; |
78 map[keys::kTtsEngine] = ext_and_packaged; | 77 map[keys::kTtsEngine] = ext_and_packaged; |
79 map[keys::kFileBrowserHandlers] = ext_and_packaged; | 78 map[keys::kFileBrowserHandlers] = ext_and_packaged; |
80 | 79 |
81 // Extensions, packaged apps and platform apps. | 80 // Extensions, packaged apps and platform apps. |
82 int local_apps_and_ext = ext_and_packaged | Manifest::kTypePlatformApp; | 81 int local_apps_and_ext = ext_and_packaged | Manifest::kTypePlatformApp; |
83 map[keys::kContentSecurityPolicy] = local_apps_and_ext; | 82 map[keys::kContentSecurityPolicy] = local_apps_and_ext; |
84 map[keys::kIncognito] = local_apps_and_ext; | 83 map[keys::kIncognito] = local_apps_and_ext; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 223 |
225 bool Manifest::CanAccessPath(const std::string& path) const { | 224 bool Manifest::CanAccessPath(const std::string& path) const { |
226 std::vector<std::string> components; | 225 std::vector<std::string> components; |
227 base::SplitString(path, '.', &components); | 226 base::SplitString(path, '.', &components); |
228 | 227 |
229 Restrictions restrictions = g_restrictions.Get(); | 228 Restrictions restrictions = g_restrictions.Get(); |
230 return restrictions.CanAccessKey(components[0], GetType()); | 229 return restrictions.CanAccessKey(components[0], GetType()); |
231 } | 230 } |
232 | 231 |
233 } // namespace extensions | 232 } // namespace extensions |
OLD | NEW |