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

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

Issue 9150008: Introduce background.scripts feature for extension manifests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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) 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 map[keys::kConvertedFromUserScript] = all_but_themes; 61 map[keys::kConvertedFromUserScript] = all_but_themes;
62 map[keys::kNaClModules] = all_but_themes; 62 map[keys::kNaClModules] = all_but_themes;
63 map[keys::kWebAccessibleResources] = all_but_themes; 63 map[keys::kWebAccessibleResources] = all_but_themes;
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::kBackgroundScripts] = ext_and_packaged;
71 map[keys::kContentScripts] = ext_and_packaged; 72 map[keys::kContentScripts] = ext_and_packaged;
72 map[keys::kOmnibox] = ext_and_packaged; 73 map[keys::kOmnibox] = ext_and_packaged;
73 map[keys::kDevToolsPage] = ext_and_packaged; 74 map[keys::kDevToolsPage] = ext_and_packaged;
74 map[keys::kSidebar] = ext_and_packaged; 75 map[keys::kSidebar] = ext_and_packaged;
75 map[keys::kHomepageURL] = ext_and_packaged; 76 map[keys::kHomepageURL] = ext_and_packaged;
76 map[keys::kChromeURLOverrides] = ext_and_packaged; 77 map[keys::kChromeURLOverrides] = ext_and_packaged;
77 map[keys::kInputComponents] = ext_and_packaged; 78 map[keys::kInputComponents] = ext_and_packaged;
78 map[keys::kTtsEngine] = ext_and_packaged; 79 map[keys::kTtsEngine] = ext_and_packaged;
79 map[keys::kFileBrowserHandlers] = ext_and_packaged; 80 map[keys::kFileBrowserHandlers] = ext_and_packaged;
80 81
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 225
225 bool Manifest::CanAccessPath(const std::string& path) const { 226 bool Manifest::CanAccessPath(const std::string& path) const {
226 std::vector<std::string> components; 227 std::vector<std::string> components;
227 base::SplitString(path, '.', &components); 228 base::SplitString(path, '.', &components);
228 229
229 Restrictions restrictions = g_restrictions.Get(); 230 Restrictions restrictions = g_restrictions.Get();
230 return restrictions.CanAccessKey(components[0], GetType()); 231 return restrictions.CanAccessKey(components[0], GetType());
231 } 232 }
232 233
233 } // namespace extensions 234 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698