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