2016-01-19 21:09:01 +01:00
|
|
|
// 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.
|
|
|
|
|
2016-11-18 00:52:42 +01:00
|
|
|
#include "tests/cefclient/browser/window_test_runner.h"
|
2016-01-19 21:09:01 +01:00
|
|
|
|
2024-01-20 03:22:56 +01:00
|
|
|
namespace client::window_test {
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
// static
|
|
|
|
void WindowTestRunner::ModifyBounds(const CefRect& display, CefRect& window) {
|
|
|
|
window.x += display.x;
|
|
|
|
window.y += display.y;
|
|
|
|
|
2023-01-02 23:59:03 +01:00
|
|
|
if (window.x < display.x) {
|
2016-01-19 21:09:01 +01:00
|
|
|
window.x = display.x;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (window.y < display.y) {
|
2016-01-19 21:09:01 +01:00
|
|
|
window.y = display.y;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (window.width < 100) {
|
2016-01-19 21:09:01 +01:00
|
|
|
window.width = 100;
|
2023-01-02 23:59:03 +01:00
|
|
|
} else if (window.width >= display.width) {
|
2016-01-19 21:09:01 +01:00
|
|
|
window.width = display.width;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (window.height < 100) {
|
2016-01-19 21:09:01 +01:00
|
|
|
window.height = 100;
|
2023-01-02 23:59:03 +01:00
|
|
|
} else if (window.height >= display.height) {
|
2016-01-19 21:09:01 +01:00
|
|
|
window.height = display.height;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (window.x + window.width >= display.x + display.width) {
|
2016-01-19 21:09:01 +01:00
|
|
|
window.x = display.x + display.width - window.width;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (window.y + window.height >= display.y + display.height) {
|
2016-01-19 21:09:01 +01:00
|
|
|
window.y = display.y + display.height - window.height;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
2016-01-19 21:09:01 +01:00
|
|
|
}
|
|
|
|
|
2023-09-25 21:40:17 +02:00
|
|
|
void WindowTestRunner::Fullscreen(CefRefPtr<CefBrowser> browser) {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
}
|
|
|
|
|
2023-03-16 18:19:50 +01:00
|
|
|
void WindowTestRunner::SetTitleBarHeight(CefRefPtr<CefBrowser> browser,
|
|
|
|
const std::optional<float>& height) {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
}
|
|
|
|
|
2024-01-20 03:22:56 +01:00
|
|
|
} // namespace client::window_test
|