2015-01-30 19:07:13 +01:00
|
|
|
// Copyright (c) 2015 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.
|
|
|
|
|
2015-01-31 01:55:56 +01:00
|
|
|
#ifndef CEF_TESTS_CEFCLIENT_BROWSER_BROWSER_WINDOW_OSR_MAC_H_
|
|
|
|
#define CEF_TESTS_CEFCLIENT_BROWSER_BROWSER_WINDOW_OSR_MAC_H_
|
|
|
|
#pragma once
|
2015-01-30 19:07:13 +01:00
|
|
|
|
2016-11-18 00:52:42 +01:00
|
|
|
#include "tests/cefclient/browser/browser_window.h"
|
|
|
|
#include "tests/cefclient/browser/client_handler_osr.h"
|
|
|
|
#include "tests/cefclient/browser/osr_renderer.h"
|
|
|
|
#include "tests/cefclient/browser/text_input_client_osr_mac.h"
|
2015-01-30 19:07:13 +01:00
|
|
|
|
|
|
|
namespace client {
|
|
|
|
|
2019-04-23 19:17:56 +02:00
|
|
|
class BrowserWindowOsrMacImpl;
|
|
|
|
|
2015-01-30 19:07:13 +01:00
|
|
|
// Represents a native child window hosting a single off-screen browser
|
|
|
|
// instance. The methods of this class must be called on the main thread unless
|
|
|
|
// otherwise indicated.
|
|
|
|
class BrowserWindowOsrMac : public BrowserWindow,
|
|
|
|
public ClientHandlerOsr::OsrDelegate {
|
|
|
|
public:
|
|
|
|
// Constructor may be called on any thread.
|
|
|
|
// |delegate| must outlive this object.
|
|
|
|
BrowserWindowOsrMac(BrowserWindow::Delegate* delegate,
|
2022-03-22 19:31:30 +01:00
|
|
|
bool with_controls,
|
2015-01-30 19:07:13 +01:00
|
|
|
const std::string& startup_url,
|
2018-09-26 13:25:58 +02:00
|
|
|
const OsrRendererSettings& settings);
|
2015-01-30 19:07:13 +01:00
|
|
|
~BrowserWindowOsrMac();
|
|
|
|
|
|
|
|
// BrowserWindow methods.
|
|
|
|
void CreateBrowser(ClientWindowHandle parent_handle,
|
|
|
|
const CefRect& rect,
|
2015-02-14 00:17:08 +01:00
|
|
|
const CefBrowserSettings& settings,
|
2019-03-19 10:42:54 +01:00
|
|
|
CefRefPtr<CefDictionaryValue> extra_info,
|
2021-06-17 21:43:06 +02:00
|
|
|
CefRefPtr<CefRequestContext> request_context) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
void GetPopupConfig(CefWindowHandle temp_handle,
|
|
|
|
CefWindowInfo& windowInfo,
|
|
|
|
CefRefPtr<CefClient>& client,
|
2021-06-17 21:43:06 +02:00
|
|
|
CefBrowserSettings& settings) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
void ShowPopup(ClientWindowHandle parent_handle,
|
2017-05-17 11:29:28 +02:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
size_t width,
|
2021-06-17 21:43:06 +02:00
|
|
|
size_t height) override;
|
|
|
|
void Show() override;
|
|
|
|
void Hide() override;
|
|
|
|
void SetBounds(int x, int y, size_t width, size_t height) override;
|
|
|
|
void SetFocus(bool focus) override;
|
|
|
|
void SetDeviceScaleFactor(float device_scale_factor) override;
|
|
|
|
float GetDeviceScaleFactor() const override;
|
|
|
|
ClientWindowHandle GetWindowHandle() const override;
|
2015-01-30 19:07:13 +01:00
|
|
|
|
|
|
|
// ClientHandlerOsr::OsrDelegate methods.
|
2021-06-17 21:43:06 +02:00
|
|
|
void OnAfterCreated(CefRefPtr<CefBrowser> browser) override;
|
|
|
|
void OnBeforeClose(CefRefPtr<CefBrowser> browser) override;
|
|
|
|
bool GetRootScreenRect(CefRefPtr<CefBrowser> browser, CefRect& rect) override;
|
|
|
|
void GetViewRect(CefRefPtr<CefBrowser> browser, CefRect& rect) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
bool GetScreenPoint(CefRefPtr<CefBrowser> browser,
|
|
|
|
int viewX,
|
|
|
|
int viewY,
|
|
|
|
int& screenX,
|
2021-06-17 21:43:06 +02:00
|
|
|
int& screenY) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
bool GetScreenInfo(CefRefPtr<CefBrowser> browser,
|
2021-06-17 21:43:06 +02:00
|
|
|
CefScreenInfo& screen_info) override;
|
|
|
|
void OnPopupShow(CefRefPtr<CefBrowser> browser, bool show) override;
|
|
|
|
void OnPopupSize(CefRefPtr<CefBrowser> browser, const CefRect& rect) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
void OnPaint(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRenderHandler::PaintElementType type,
|
|
|
|
const CefRenderHandler::RectList& dirtyRects,
|
|
|
|
const void* buffer,
|
|
|
|
int width,
|
2021-06-17 21:43:06 +02:00
|
|
|
int height) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefCursorHandle cursor,
|
2020-10-28 17:30:54 +01:00
|
|
|
cef_cursor_type_t type,
|
2021-06-17 21:43:06 +02:00
|
|
|
const CefCursorInfo& custom_cursor_info) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
bool StartDragging(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefDragData> drag_data,
|
|
|
|
CefRenderHandler::DragOperationsMask allowed_ops,
|
2017-05-17 11:29:28 +02:00
|
|
|
int x,
|
2021-06-17 21:43:06 +02:00
|
|
|
int y) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
void UpdateDragCursor(CefRefPtr<CefBrowser> browser,
|
2021-06-17 21:43:06 +02:00
|
|
|
CefRenderHandler::DragOperation operation) override;
|
2016-10-28 18:11:24 +02:00
|
|
|
void OnImeCompositionRangeChanged(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefRange& selection_range,
|
2021-06-17 21:43:06 +02:00
|
|
|
const CefRenderHandler::RectList& character_bounds) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
|
2021-06-17 21:43:06 +02:00
|
|
|
void UpdateAccessibilityTree(CefRefPtr<CefValue> value) override;
|
|
|
|
void UpdateAccessibilityLocation(CefRefPtr<CefValue> value) override;
|
2017-05-12 20:28:25 +02:00
|
|
|
|
2015-01-30 19:07:13 +01:00
|
|
|
private:
|
2021-06-17 22:08:01 +02:00
|
|
|
std::unique_ptr<BrowserWindowOsrMacImpl> impl_;
|
2015-01-30 19:07:13 +01:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(BrowserWindowOsrMac);
|
2019-04-23 19:17:56 +02:00
|
|
|
|
|
|
|
friend class BrowserWindowOsrMacImpl;
|
2015-01-30 19:07:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace client
|
|
|
|
|
2015-01-31 01:55:56 +01:00
|
|
|
#endif // CEF_TESTS_CEFCLIENT_BROWSER_BROWSER_WINDOW_OSR_MAC_H_
|