blob: 1da14aabf8353a4dacaf2a2d495cf343bb4f7b13 [file] [log] [blame]
Avi Drissman3e1a26c2022-09-15 20:26:031// Copyright 2012 The Chromium Authors
[email protected]ec015c82012-04-12 23:41:532// 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]ec015c82012-04-12 23:41:537
8#include <windows.h>
Takuto Ikutac8d6b16f2024-04-15 16:59:199
avi20f6a6d532015-12-23 08:05:2410#include <stdint.h>
[email protected]ec015c82012-04-12 23:41:5311
Peter Varga1b04be92022-11-28 20:26:2512#include <memory>
Helmut Januschka36619c12024-04-24 14:33:1913#include <string_view>
Peter Varga1b04be92022-11-28 20:26:2514#include <vector>
15
[email protected]ec015c82012-04-12 23:41:5316#include "ui/base/resource/resource_handle.h"
17
18namespace ui {
19
20class ResourceDataDLL : public ResourceHandle {
21 public:
22 explicit ResourceDataDLL(HINSTANCE module);
Peter Boströmc8c12352021-09-21 23:37:1523
24 ResourceDataDLL(const ResourceDataDLL&) = delete;
25 ResourceDataDLL& operator=(const ResourceDataDLL&) = delete;
26
dcheng98a21052015-04-21 05:14:3827 ~ResourceDataDLL() override;
[email protected]ec015c82012-04-12 23:41:5328
29 // ResourceHandle implementation:
avi20f6a6d532015-12-23 08:05:2430 bool HasResource(uint16_t resource_id) const override;
Ho Cheung183477762024-10-09 02:35:1331 std::optional<std::string_view> GetStringView(
Greg Thompsonc5715d02023-08-04 18:18:0132 uint16_t resource_id) const override;
dcheng98a21052015-04-21 05:14:3833 base::RefCountedStaticMemory* GetStaticMemory(
avi20f6a6d532015-12-23 08:05:2434 uint16_t resource_id) const override;
dcheng98a21052015-04-21 05:14:3835 TextEncodingType GetTextEncodingType() const override;
Mitsuru Oshimad46b99d2021-07-01 14:52:2336 ResourceScaleFactor GetResourceScaleFactor() const override;
Eriko Kurimoto13026d62022-03-03 04:39:3237#if DCHECK_IS_ON()
38 void CheckForDuplicateResources(
39 const std::vector<std::unique_ptr<ResourceHandle>>& packs) override {}
40#endif
[email protected]ec015c82012-04-12 23:41:5341
42 private:
43 const HINSTANCE module_;
[email protected]ec015c82012-04-12 23:41:5344};
45
46} // namespace ui
47
48#endif // UI_BASE_RESOURCE_RESOURCE_DATA_DLL_WIN_H_