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

Side by Side Diff: chrome/common/extensions/manifest_handler.h

Issue 11446034: SupportsUserData and manifest handlers for Extension; use them for the Omnibox API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + manifestdata Created 8 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
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/manifest_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLER_H_
6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/string16.h"
12
13 namespace base {
14 class Value;
15 }
16
17 namespace extensions {
18
19 class Extension;
20
21 class ManifestHandler {
22 public:
23 ManifestHandler();
24 virtual ~ManifestHandler();
25
26 // Attempts to parse the manifest value.
27 // Returns true on success or false on failure; if false, |error| will
28 // be set to a failure message.
29 virtual bool Parse(const base::Value* value,
30 Extension* extension,
31 string16* error) = 0;
32
33 // Associate |handler| with |key| in the manifest. Takes ownership
34 // of |handler|. TODO(yoz): Decide how to handle dotted subkeys.
35 // WARNING: Manifest handlers registered only in the browser process
36 // are not available to renderers.
37 static void Register(const std::string& key, ManifestHandler* handler);
38
39 // Get the manifest handler associated with |key|, or NULL
40 // if there is none.
41 static ManifestHandler* Get(const std::string& key);
42
43 // If the handler is not handling most of the keys, it may be
44 // more efficient to have a list of keys to iterate over.
45 // TODO(yoz): this isn't the long-term solution.
46 static std::vector<std::string> GetKeys();
47 };
48
49
50 } // namespace extensions
51
52 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/manifest_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698