Avi Drissman | 3e1a26c | 2022-09-15 20:26:03 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | ec015c8 | 2012-04-12 23:41:53 | [diff] [blame] | 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 UI_BASE_RESOURCE_RESOURCE_DATA_DLL_WIN_H_ | ||||
6 | #define UI_BASE_RESOURCE_RESOURCE_DATA_DLL_WIN_H_ | ||||
[email protected] | ec015c8 | 2012-04-12 23:41:53 | [diff] [blame] | 7 | |
8 | #include <windows.h> | ||||
Takuto Ikuta | c8d6b16f | 2024-04-15 16:59:19 | [diff] [blame^] | 9 | |
avi | 20f6a6d53 | 2015-12-23 08:05:24 | [diff] [blame] | 10 | #include <stdint.h> |
[email protected] | ec015c8 | 2012-04-12 23:41:53 | [diff] [blame] | 11 | |
Peter Varga | 1b04be9 | 2022-11-28 20:26:25 | [diff] [blame] | 12 | #include <memory> |
13 | #include <vector> | ||||
14 | |||||
[email protected] | ec015c8 | 2012-04-12 23:41:53 | [diff] [blame] | 15 | #include "ui/base/resource/resource_handle.h" |
16 | |||||
17 | namespace ui { | ||||
18 | |||||
19 | class ResourceDataDLL : public ResourceHandle { | ||||
20 | public: | ||||
21 | explicit ResourceDataDLL(HINSTANCE module); | ||||
Peter Boström | c8c1235 | 2021-09-21 23:37:15 | [diff] [blame] | 22 | |
23 | ResourceDataDLL(const ResourceDataDLL&) = delete; | ||||
24 | ResourceDataDLL& operator=(const ResourceDataDLL&) = delete; | ||||
25 | |||||
dcheng | 98a2105 | 2015-04-21 05:14:38 | [diff] [blame] | 26 | ~ResourceDataDLL() override; |
[email protected] | ec015c8 | 2012-04-12 23:41:53 | [diff] [blame] | 27 | |
28 | // ResourceHandle implementation: | ||||
avi | 20f6a6d53 | 2015-12-23 08:05:24 | [diff] [blame] | 29 | bool HasResource(uint16_t resource_id) const override; |
Arthur Sonzogni | 3eb9fd51 | 2024-02-09 12:20:43 | [diff] [blame] | 30 | std::optional<base::StringPiece> GetStringPiece( |
Greg Thompson | c5715d0 | 2023-08-04 18:18:01 | [diff] [blame] | 31 | uint16_t resource_id) const override; |
dcheng | 98a2105 | 2015-04-21 05:14:38 | [diff] [blame] | 32 | base::RefCountedStaticMemory* GetStaticMemory( |
avi | 20f6a6d53 | 2015-12-23 08:05:24 | [diff] [blame] | 33 | uint16_t resource_id) const override; |
dcheng | 98a2105 | 2015-04-21 05:14:38 | [diff] [blame] | 34 | TextEncodingType GetTextEncodingType() const override; |
Mitsuru Oshima | d46b99d | 2021-07-01 14:52:23 | [diff] [blame] | 35 | ResourceScaleFactor GetResourceScaleFactor() const override; |
Eriko Kurimoto | 13026d6 | 2022-03-03 04:39:32 | [diff] [blame] | 36 | #if DCHECK_IS_ON() |
37 | void CheckForDuplicateResources( | ||||
38 | const std::vector<std::unique_ptr<ResourceHandle>>& packs) override {} | ||||
39 | #endif | ||||
[email protected] | ec015c8 | 2012-04-12 23:41:53 | [diff] [blame] | 40 | |
41 | private: | ||||
42 | const HINSTANCE module_; | ||||
[email protected] | ec015c8 | 2012-04-12 23:41:53 | [diff] [blame] | 43 | }; |
44 | |||||
45 | } // namespace ui | ||||
46 | |||||
47 | #endif // UI_BASE_RESOURCE_RESOURCE_DATA_DLL_WIN_H_ |