cef/tests/cefclient/browser/window_test_runner_views.h
Nik Pavlov c83b3cda24 views: mac: Support dynamic resize of title bar height (see #3189)
This is intended for usage with frameless windows that show the standard window
buttons, where resizing the title bar height changes the button offset. Returning a
different value from CefWindowDelegate::GetTitlebarHeight and forcing a resize of
the NSWindow's theme frame (see ViewsWindow::NudgeWindow) will update the
title bar height.

To test:
1. Run `cefclient --use-views --hide-frame --show-window-buttons --url=http://tests/window`
2. Enter a new value for title bar height and click the "Set Titlebar Height" button
2023-03-16 17:19:50 +00:00

35 lines
1.1 KiB
C++

// Copyright (c) 2016 The Chromium Embedded Framework 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_TESTS_CEFCLIENT_BROWSER_WINDOW_TEST_RUNNER_VIEWS_H_
#define CEF_TESTS_CEFCLIENT_BROWSER_WINDOW_TEST_RUNNER_VIEWS_H_
#pragma once
#include "tests/cefclient/browser/window_test_runner.h"
namespace client {
namespace window_test {
// Views platform implementation.
class WindowTestRunnerViews : public WindowTestRunner {
public:
WindowTestRunnerViews();
void SetPos(CefRefPtr<CefBrowser> browser,
int x,
int y,
int width,
int height) override;
void Minimize(CefRefPtr<CefBrowser> browser) override;
void Maximize(CefRefPtr<CefBrowser> browser) override;
void Restore(CefRefPtr<CefBrowser> browser) override;
void SetTitleBarHeight(CefRefPtr<CefBrowser> browser,
const std::optional<float>& height) override;
};
} // namespace window_test
} // namespace client
#endif // CEF_TESTS_CEFCLIENT_BROWSER_WINDOW_TEST_RUNNER_VIEWS_H_