| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_COMMON_EXTENSIONS_API_FILE_BROWSER_HANDLERS_FILE_BROWSER_HANDLER_
H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_API_FILE_BROWSER_HANDLERS_FILE_BROWSER_HANDLER_
H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_API_FILE_BROWSER_HANDLERS_FILE_BROWSER_HANDLER_
H_ | 6 #define CHROME_COMMON_EXTENSIONS_API_FILE_BROWSER_HANDLERS_FILE_BROWSER_HANDLER_
H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "extensions/common/extension.h" | 11 #include "extensions/common/extension.h" |
| 12 #include "extensions/common/manifest_handler.h" | 12 #include "extensions/common/manifest_handler.h" |
| 13 #include "extensions/common/url_pattern.h" | 13 #include "extensions/common/url_pattern.h" |
| 14 #include "extensions/common/url_pattern_set.h" | 14 #include "extensions/common/url_pattern_set.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 class URLPattern; | 17 class URLPattern; |
| 18 | 18 |
| 19 // FileBrowserHandler encapsulates the state of a file browser action. | 19 // FileBrowserHandler encapsulates the state of a file browser action. |
| 20 class FileBrowserHandler { | 20 class FileBrowserHandler { |
| 21 public: | 21 public: |
| 22 typedef std::vector<linked_ptr<FileBrowserHandler> > List; | 22 using List = std::vector<std::unique_ptr<FileBrowserHandler>>; |
| 23 | 23 |
| 24 FileBrowserHandler(); | 24 FileBrowserHandler(); |
| 25 ~FileBrowserHandler(); | 25 ~FileBrowserHandler(); |
| 26 | 26 |
| 27 // extension id | 27 // extension id |
| 28 std::string extension_id() const { return extension_id_; } | 28 std::string extension_id() const { return extension_id_; } |
| 29 void set_extension_id(const std::string& extension_id) { | 29 void set_extension_id(const std::string& extension_id) { |
| 30 extension_id_ = extension_id; | 30 extension_id_ = extension_id; |
| 31 } | 31 } |
| 32 | 32 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // extension manifest). | 75 // extension manifest). |
| 76 std::string extension_id_; | 76 std::string extension_id_; |
| 77 std::string title_; | 77 std::string title_; |
| 78 std::string default_icon_path_; | 78 std::string default_icon_path_; |
| 79 // The id for the FileBrowserHandler, for example: "PdfFileAction". | 79 // The id for the FileBrowserHandler, for example: "PdfFileAction". |
| 80 std::string id_; | 80 std::string id_; |
| 81 unsigned int file_access_permission_flags_; | 81 unsigned int file_access_permission_flags_; |
| 82 | 82 |
| 83 // A list of file filters. | 83 // A list of file filters. |
| 84 extensions::URLPatternSet url_set_; | 84 extensions::URLPatternSet url_set_; |
| 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(FileBrowserHandler); |
| 85 }; | 87 }; |
| 86 | 88 |
| 87 // Parses the "file_browser_handlers" extension manifest key. | 89 // Parses the "file_browser_handlers" extension manifest key. |
| 88 class FileBrowserHandlerParser : public extensions::ManifestHandler { | 90 class FileBrowserHandlerParser : public extensions::ManifestHandler { |
| 89 public: | 91 public: |
| 90 FileBrowserHandlerParser(); | 92 FileBrowserHandlerParser(); |
| 91 ~FileBrowserHandlerParser() override; | 93 ~FileBrowserHandlerParser() override; |
| 92 | 94 |
| 93 bool Parse(extensions::Extension* extension, base::string16* error) override; | 95 bool Parse(extensions::Extension* extension, base::string16* error) override; |
| 94 | 96 |
| 95 private: | 97 private: |
| 96 const std::vector<std::string> Keys() const override; | 98 const std::vector<std::string> Keys() const override; |
| 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(FileBrowserHandlerParser); |
| 97 }; | 101 }; |
| 98 | 102 |
| 99 #endif // CHROME_COMMON_EXTENSIONS_API_FILE_BROWSER_HANDLERS_FILE_BROWSER_HANDL
ER_H_ | 103 #endif // CHROME_COMMON_EXTENSIONS_API_FILE_BROWSER_HANDLERS_FILE_BROWSER_HANDL
ER_H_ |
| OLD | NEW |