#ifndef UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
#define UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
#include <memory>
#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/views_delegate.h"
namespace views {
class TestViewsDelegate : public ViewsDelegate {
public:
TestViewsDelegate();
TestViewsDelegate(const TestViewsDelegate&) = delete;
TestViewsDelegate& operator=(const TestViewsDelegate&) = delete;
~TestViewsDelegate() override;
void set_use_desktop_native_widgets(bool desktop) {
use_desktop_native_widgets_ = desktop;
}
void set_use_transparent_windows(bool transparent) {
use_transparent_windows_ = transparent;
}
#if BUILDFLAG(IS_CHROMEOS)
void set_context(gfx::NativeWindow context) { context_ = context; }
#endif
#if BUILDFLAG(IS_MAC)
void set_context_factory(ui::ContextFactory* context_factory) {
context_factory_ = context_factory;
}
#endif
void set_layout_provider(std::unique_ptr<LayoutProvider> layout_provider) {
layout_provider_.swap(layout_provider);
}
#if BUILDFLAG(IS_WIN)
HICON GetSmallWindowIcon() const override;
#endif
void OnBeforeWidgetInit(Widget::InitParams* params,
internal::NativeWidgetDelegate* delegate) override;
#if BUILDFLAG(IS_MAC)
ui::ContextFactory* GetContextFactory() override;
#endif
private:
#if BUILDFLAG(IS_MAC)
raw_ptr<ui::ContextFactory> context_factory_ = nullptr;
#endif
bool use_desktop_native_widgets_ = false;
bool use_transparent_windows_ = false;
std::unique_ptr<LayoutProvider> layout_provider_ =
std::make_unique<LayoutProvider>();
#if BUILDFLAG(IS_CHROMEOS)
gfx::NativeWindow context_ = gfx::NativeWindow();
#endif
};
}
#endif