Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / extensions / chrome_component_extension_resource_manager.h
blobe3609490d385dae0864ea81cb7418ea42d9e1378
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 CHROME_BROWSER_EXTENSIONS_CHROME_COMPONENT_EXTENSION_RESOURCE_MANAGER_H_
6 #define CHROME_BROWSER_EXTENSIONS_CHROME_COMPONENT_EXTENSION_RESOURCE_MANAGER_H_
8 #include <map>
10 #include "base/basictypes.h"
11 #include "base/files/file_path.h"
12 #include "extensions/browser/component_extension_resource_manager.h"
14 struct GritResourceMap;
16 namespace extensions {
18 class ChromeComponentExtensionResourceManager
19 : public ComponentExtensionResourceManager {
20 public:
21 ChromeComponentExtensionResourceManager();
22 ~ChromeComponentExtensionResourceManager() override;
24 // Overridden from ComponentExtensionResourceManager:
25 bool IsComponentExtensionResource(const base::FilePath& extension_path,
26 const base::FilePath& resource_path,
27 int* resource_id) const override;
29 private:
30 void AddComponentResourceEntries(const GritResourceMap* entries, size_t size);
32 // A map from a resource path to the resource ID. Used by
33 // IsComponentExtensionResource.
34 std::map<base::FilePath, int> path_to_resource_id_;
36 DISALLOW_COPY_AND_ASSIGN(ChromeComponentExtensionResourceManager);
39 } // namespace extensions
41 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_COMPONENT_EXTENSION_RESOURCE_MANAGER_H_