Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / common / extensions / api / file_handlers / file_handlers_parser.h
blob5d3e3cf6332021b01071bc23d3f0aedea6d2b345
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.
5 #ifndef CHROME_COMMON_EXTENSIONS_API_FILE_HANDLERS_FILE_HANDLERS_PARSER_H_
6 #define CHROME_COMMON_EXTENSIONS_API_FILE_HANDLERS_FILE_HANDLERS_PARSER_H_
8 #include <set>
9 #include <string>
10 #include <vector>
12 #include "extensions/common/extension.h"
13 #include "extensions/common/manifest_handler.h"
15 namespace extensions {
17 struct FileHandlerInfo {
18 FileHandlerInfo();
19 ~FileHandlerInfo();
21 std::string id;
22 std::string title;
24 // File extensions associated with this handler.
25 std::set<std::string> extensions;
27 // MIME types associated with this handler.
28 std::set<std::string> types;
31 struct FileHandlers : public Extension::ManifestData {
32 FileHandlers();
33 virtual ~FileHandlers();
35 std::vector<FileHandlerInfo> file_handlers;
37 static const std::vector<FileHandlerInfo>* GetFileHandlers(
38 const Extension* extension);
41 // Parses the "file_handlers" manifest key.
42 class FileHandlersParser : public ManifestHandler {
43 public:
44 FileHandlersParser();
45 virtual ~FileHandlersParser();
47 virtual bool Parse(Extension* extension, base::string16* error) OVERRIDE;
49 private:
50 virtual const std::vector<std::string> Keys() const OVERRIDE;
52 DISALLOW_COPY_AND_ASSIGN(FileHandlersParser);
55 } // namespace extensions
57 #endif // CHROME_COMMON_EXTENSIONS_API_FILE_HANDLERS_FILE_HANDLERS_PARSER_H_