2019-09-04 17:13:32 +02:00
|
|
|
// Copyright 2019 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions copyright 2014 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_DELEGATE_H_
|
|
|
|
#define CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_DELEGATE_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ui/base/resource/resource_bundle.h"
|
|
|
|
|
|
|
|
class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate {
|
|
|
|
public:
|
2024-05-03 18:50:23 +02:00
|
|
|
CefResourceBundleDelegate();
|
|
|
|
|
|
|
|
CefResourceBundleDelegate(const CefResourceBundleDelegate&) = delete;
|
|
|
|
CefResourceBundleDelegate& operator=(const CefResourceBundleDelegate&) =
|
|
|
|
delete;
|
2020-06-28 23:05:36 +02:00
|
|
|
|
2019-09-04 17:13:32 +02:00
|
|
|
private:
|
|
|
|
// ui::ResourceBundle::Delegate methods.
|
2021-08-20 01:40:49 +02:00
|
|
|
base::FilePath GetPathForResourcePack(
|
|
|
|
const base::FilePath& pack_path,
|
|
|
|
ui::ResourceScaleFactor scale_factor) override;
|
2019-09-04 17:13:32 +02:00
|
|
|
base::FilePath GetPathForLocalePack(const base::FilePath& pack_path,
|
|
|
|
const std::string& locale) override;
|
|
|
|
gfx::Image GetImageNamed(int resource_id) override;
|
|
|
|
gfx::Image GetNativeImageNamed(int resource_id) override;
|
2024-11-14 23:07:03 +01:00
|
|
|
bool HasDataResource(int resource_id) const override;
|
2022-03-26 02:12:30 +01:00
|
|
|
base::RefCountedMemory* LoadDataResourceBytes(
|
2019-09-04 17:13:32 +02:00
|
|
|
int resource_id,
|
2021-08-20 01:40:49 +02:00
|
|
|
ui::ResourceScaleFactor scale_factor) override;
|
2024-03-19 22:11:42 +01:00
|
|
|
std::optional<std::string> LoadDataResourceString(int resource_id) override;
|
2019-09-04 17:13:32 +02:00
|
|
|
bool GetRawDataResource(int resource_id,
|
2021-08-20 01:40:49 +02:00
|
|
|
ui::ResourceScaleFactor scale_factor,
|
2024-04-23 22:06:00 +02:00
|
|
|
std::string_view* value) const override;
|
2021-04-21 00:52:34 +02:00
|
|
|
bool GetLocalizedString(int message_id, std::u16string* value) const override;
|
2019-09-04 17:13:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_DELEGATE_H_
|