[email protected] | 326e6f0 | 2014-06-20 04:53:37 | [diff] [blame] | 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. |
| 4 | |
| 5 | #ifndef EXTENSIONS_BROWSER_COMPONENT_EXTENSION_RESOURCE_MANAGER_H_ |
| 6 | #define EXTENSIONS_BROWSER_COMPONENT_EXTENSION_RESOURCE_MANAGER_H_ |
| 7 | |
Sam McNally | b2850e38 | 2019-01-23 07:46:59 | [diff] [blame] | 8 | #include <string> |
| 9 | |
| 10 | #include "ui/base/template_expressions.h" |
| 11 | |
[email protected] | 326e6f0 | 2014-06-20 04:53:37 | [diff] [blame] | 12 | namespace base { |
| 13 | class FilePath; |
| 14 | } |
| 15 | |
| 16 | namespace extensions { |
| 17 | |
| 18 | // This class manages which extension resources actually come from |
| 19 | // the resource bundle. |
| 20 | class ComponentExtensionResourceManager { |
| 21 | public: |
| 22 | virtual ~ComponentExtensionResourceManager() {} |
| 23 | |
| 24 | // Checks whether image is a component extension resource. Returns false |
| 25 | // if a given |resource| does not have a corresponding image in bundled |
| 26 | // resources. Otherwise fills |resource_id|. This doesn't check if the |
| 27 | // extension the resource is in is actually a component extension. |
| 28 | virtual bool IsComponentExtensionResource( |
mukai | ee458c9 | 2015-01-06 01:30:33 | [diff] [blame] | 29 | const base::FilePath& extension_path, |
| 30 | const base::FilePath& resource_path, |
dpapad | 669a8970 | 2019-05-10 18:00:49 | [diff] [blame] | 31 | int* resource_id) const = 0; |
Sam McNally | b2850e38 | 2019-01-23 07:46:59 | [diff] [blame] | 32 | |
| 33 | // Returns the i18n template replacements for a component extension if they |
| 34 | // exist, or nullptr otherwise. If non-null, the returned value must remain |
| 35 | // valid for the life of this ComponentExtensionResourceManager. |
| 36 | virtual const ui::TemplateReplacements* GetTemplateReplacementsForExtension( |
| 37 | const std::string& extension_id) const = 0; |
[email protected] | 326e6f0 | 2014-06-20 04:53:37 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | } // namespace extensions |
| 41 | |
| 42 | #endif // EXTENSIONS_BROWSER_COMPONENT_EXTENSION_RESOURCE_MANAGER_H_ |