blob: b8a1f556c82cb07ae34268f5a5a25b2ebbaf2d7d [file] [log] [blame]
[email protected]326e6f02014-06-20 04:53:371// 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 McNallyb2850e382019-01-23 07:46:598#include <string>
9
10#include "ui/base/template_expressions.h"
11
[email protected]326e6f02014-06-20 04:53:3712namespace base {
13class FilePath;
14}
15
16namespace extensions {
17
18// This class manages which extension resources actually come from
19// the resource bundle.
20class 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(
mukaiee458c92015-01-06 01:30:3329 const base::FilePath& extension_path,
30 const base::FilePath& resource_path,
dpapad669a89702019-05-10 18:00:4931 int* resource_id) const = 0;
Sam McNallyb2850e382019-01-23 07:46:5932
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]326e6f02014-06-20 04:53:3738};
39
40} // namespace extensions
41
42#endif // EXTENSIONS_BROWSER_COMPONENT_EXTENSION_RESOURCE_MANAGER_H_