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