1 // Copyright 2014 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 EXTENSIONS_COMMON_MANIFEST_HANDLERS_FILE_HANDLER_INFO_H_
6 #define EXTENSIONS_COMMON_MANIFEST_HANDLERS_FILE_HANDLER_INFO_H_
12 #include "extensions/common/extension.h"
13 #include "extensions/common/manifest_handler.h"
15 namespace extensions
{
17 struct FileHandlerInfo
{
21 // The id of this handler.
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 typedef std::vector
<FileHandlerInfo
> FileHandlersInfo
;
33 struct FileHandlers
: public Extension::ManifestData
{
35 ~FileHandlers() override
;
37 FileHandlersInfo file_handlers
;
39 static const FileHandlersInfo
* GetFileHandlers(const Extension
* extension
);
42 // Parses the "file_handlers" manifest key.
43 class FileHandlersParser
: public ManifestHandler
{
46 ~FileHandlersParser() override
;
48 bool Parse(Extension
* extension
, base::string16
* error
) override
;
51 const std::vector
<std::string
> Keys() const override
;
53 DISALLOW_COPY_AND_ASSIGN(FileHandlersParser
);
56 } // namespace extensions
58 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_FILE_HANDLER_INFO_H_