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

Side by Side Diff: chrome/common/extensions/manifest.cc

Issue 8849010: Add 'web_accessible_resource" keyword for version 2 extension manifests. This makes extension res... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 int all_but_themes = Manifest::kTypeAll - Manifest::kTypeTheme; 52 int all_but_themes = Manifest::kTypeAll - Manifest::kTypeTheme;
53 map[keys::kPermissions] = all_but_themes; 53 map[keys::kPermissions] = all_but_themes;
54 map[keys::kOptionalPermissions] = all_but_themes; 54 map[keys::kOptionalPermissions] = all_but_themes;
55 map[keys::kOptionsPage] = all_but_themes; 55 map[keys::kOptionsPage] = all_but_themes;
56 map[keys::kBackground] = all_but_themes; 56 map[keys::kBackground] = all_but_themes;
57 map[keys::kOfflineEnabled] = all_but_themes; 57 map[keys::kOfflineEnabled] = all_but_themes;
58 map[keys::kMinimumChromeVersion] = all_but_themes; 58 map[keys::kMinimumChromeVersion] = all_but_themes;
59 map[keys::kRequirements] = all_but_themes; 59 map[keys::kRequirements] = all_but_themes;
60 map[keys::kConvertedFromUserScript] = all_but_themes; 60 map[keys::kConvertedFromUserScript] = all_but_themes;
61 map[keys::kNaClModules] = all_but_themes; 61 map[keys::kNaClModules] = all_but_themes;
62 map[keys::kWebAccessibleResources] = all_but_themes;
62 63
63 // Everything except themes and platform apps. 64 // Everything except themes and platform apps.
64 map[keys::kPlugins] = all_but_themes - Manifest::kTypePlatformApp; 65 map[keys::kPlugins] = all_but_themes - Manifest::kTypePlatformApp;
65 66
66 // Extensions and packaged apps. 67 // Extensions and packaged apps.
67 int ext_and_packaged = 68 int ext_and_packaged =
68 Manifest::kTypeExtension | Manifest::kTypePackagedApp; 69 Manifest::kTypeExtension | Manifest::kTypePackagedApp;
69 map[keys::kContentScripts] = ext_and_packaged; 70 map[keys::kContentScripts] = ext_and_packaged;
70 map[keys::kOmnibox] = ext_and_packaged; 71 map[keys::kOmnibox] = ext_and_packaged;
71 map[keys::kDevToolsPage] = ext_and_packaged; 72 map[keys::kDevToolsPage] = ext_and_packaged;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 223
223 bool Manifest::CanAccessPath(const std::string& path) const { 224 bool Manifest::CanAccessPath(const std::string& path) const {
224 std::vector<std::string> components; 225 std::vector<std::string> components;
225 base::SplitString(path, '.', &components); 226 base::SplitString(path, '.', &components);
226 227
227 Restrictions restrictions = g_restrictions.Get(); 228 Restrictions restrictions = g_restrictions.Get();
228 return restrictions.CanAccessKey(components[0], GetType()); 229 return restrictions.CanAccessKey(components[0], GetType());
229 } 230 }
230 231
231 } // namespace extensions 232 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_manifests_unittest.cc ('k') | chrome/common/extensions/manifest_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698