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_
12 #include "extensions/common/extension.h"
13 #include "extensions/common/manifest_handler.h"
15 namespace extensions
{
17 struct FileHandlerInfo
{
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
{
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
{
45 virtual ~FileHandlersParser();
47 virtual bool Parse(Extension
* extension
, base::string16
* error
) OVERRIDE
;
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_