Files
cef/tests/cefclient/browser/window_test_runner.cc
Marshall Greenblatt faa85bf980 Support JavaScript window.moveTo/By() and resizeTo/By() (fixes #698)
Adds new CefDisplayHandler::OnContentsBoundsChange and
CefDisplayHandler::GetRootWindowScreenRect callbacks.

cefclient: Implement the above callbacks and call
CefBrowserHost::NotifyScreenInfoChanged when the root window
bounds change.

cefclient: osr: Use real screen bounds by default. Pass
`--fake-screen-bounds` for the old default behavior.

Load https://tests/window in cefclient for additional
implementation details and usage examples.
2025-05-05 11:53:33 -04:00

34 lines
1.0 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.
#include "tests/cefclient/browser/window_test_runner.h"
#include "tests/cefclient/browser/root_window.h"
namespace client::window_test {
void WindowTestRunner::SetPos(CefRefPtr<CefBrowser> browser,
int x,
int y,
int width,
int height) {
REQUIRE_MAIN_THREAD();
auto root_window = RootWindow::GetForBrowser(browser->GetIdentifier());
root_window->SetBounds(
x, y, width, height,
/*content_bounds=*/root_window->DefaultToContentBounds());
}
void WindowTestRunner::Fullscreen(CefRefPtr<CefBrowser> browser) {
NOTIMPLEMENTED();
}
void WindowTestRunner::SetTitleBarHeight(CefRefPtr<CefBrowser> browser,
const std::optional<float>& height) {
NOTIMPLEMENTED();
}
} // namespace client::window_test