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

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

Issue 9402018: Experimental Extension Keybinding (first cut). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 10 matching lines...) Expand all
21 21
22 typedef std::map<std::string, int> RestrictionMap; 22 typedef std::map<std::string, int> RestrictionMap;
23 23
24 struct Restrictions { 24 struct Restrictions {
25 Restrictions() { 25 Restrictions() {
26 // Base keys that all manifests can specify. 26 // Base keys that all manifests can specify.
27 map[keys::kName] = Manifest::kTypeAll; 27 map[keys::kName] = Manifest::kTypeAll;
28 map[keys::kVersion] = Manifest::kTypeAll; 28 map[keys::kVersion] = Manifest::kTypeAll;
29 map[keys::kManifestVersion] = Manifest::kTypeAll; 29 map[keys::kManifestVersion] = Manifest::kTypeAll;
30 map[keys::kDescription] = Manifest::kTypeAll; 30 map[keys::kDescription] = Manifest::kTypeAll;
31 map[keys::kCommands] = Manifest::kTypeAll;
31 map[keys::kIcons] = Manifest::kTypeAll; 32 map[keys::kIcons] = Manifest::kTypeAll;
32 map[keys::kCurrentLocale] = Manifest::kTypeAll; 33 map[keys::kCurrentLocale] = Manifest::kTypeAll;
33 map[keys::kDefaultLocale] = Manifest::kTypeAll; 34 map[keys::kDefaultLocale] = Manifest::kTypeAll;
34 map[keys::kSignature] = Manifest::kTypeAll; 35 map[keys::kSignature] = Manifest::kTypeAll;
35 map[keys::kUpdateURL] = Manifest::kTypeAll; 36 map[keys::kUpdateURL] = Manifest::kTypeAll;
36 map[keys::kPublicKey] = Manifest::kTypeAll; 37 map[keys::kPublicKey] = Manifest::kTypeAll;
37 38
38 // Type specific. 39 // Type specific.
39 map[keys::kApp] = Manifest::kTypeHostedApp | Manifest::kTypePackagedApp | 40 map[keys::kApp] = Manifest::kTypeHostedApp | Manifest::kTypePackagedApp |
40 Manifest::kTypePlatformApp; 41 Manifest::kTypePlatformApp;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 227
227 bool Manifest::CanAccessPath(const std::string& path) const { 228 bool Manifest::CanAccessPath(const std::string& path) const {
228 std::vector<std::string> components; 229 std::vector<std::string> components;
229 base::SplitString(path, '.', &components); 230 base::SplitString(path, '.', &components);
230 231
231 const Restrictions& restrictions = g_restrictions.Get(); 232 const Restrictions& restrictions = g_restrictions.Get();
232 return restrictions.CanAccessKey(components[0], GetType()); 233 return restrictions.CanAccessKey(components[0], GetType());
233 } 234 }
234 235
235 } // namespace extensions 236 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_unittest.cc ('k') | ui/base/accelerators/accelerator_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698