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