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_ROOT_WINDOW_MAC_H_
|
|
|
|
#define CEF_TESTS_CEFCLIENT_BROWSER_ROOT_WINDOW_MAC_H_
|
|
|
|
#pragma once
|
2015-01-30 19:07:13 +01:00
|
|
|
|
2021-06-17 22:08:01 +02:00
|
|
|
#include <memory>
|
2015-01-30 19:07:13 +01:00
|
|
|
#include <string>
|
|
|
|
|
2016-11-18 00:52:42 +01:00
|
|
|
#include "tests/cefclient/browser/browser_window.h"
|
|
|
|
#include "tests/cefclient/browser/root_window.h"
|
2015-01-30 19:07:13 +01:00
|
|
|
|
|
|
|
namespace client {
|
|
|
|
|
2019-04-23 19:17:56 +02:00
|
|
|
class RootWindowMacImpl;
|
|
|
|
|
2015-01-30 19:07:13 +01:00
|
|
|
// OS X implementation of a top-level native window in the browser process.
|
|
|
|
// The methods of this class must be called on the main thread unless otherwise
|
|
|
|
// indicated.
|
2017-05-17 11:29:28 +02:00
|
|
|
class RootWindowMac : public RootWindow, public BrowserWindow::Delegate {
|
2015-01-30 19:07:13 +01:00
|
|
|
public:
|
|
|
|
// Constructor may be called on any thread.
|
2024-04-17 18:01:26 +02:00
|
|
|
explicit RootWindowMac(bool use_alloy_style);
|
2015-01-30 19:07:13 +01:00
|
|
|
~RootWindowMac();
|
|
|
|
|
2019-04-23 19:17:56 +02:00
|
|
|
BrowserWindow* browser_window() const;
|
|
|
|
RootWindow::Delegate* delegate() const;
|
|
|
|
|
2015-01-30 19:07:13 +01:00
|
|
|
// RootWindow methods.
|
|
|
|
void Init(RootWindow::Delegate* delegate,
|
2021-06-19 21:54:45 +02:00
|
|
|
std::unique_ptr<RootWindowConfig> config,
|
2021-06-17 21:43:06 +02:00
|
|
|
const CefBrowserSettings& settings) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
void InitAsPopup(RootWindow::Delegate* delegate,
|
|
|
|
bool with_controls,
|
|
|
|
bool with_osr,
|
|
|
|
const CefPopupFeatures& popupFeatures,
|
|
|
|
CefWindowInfo& windowInfo,
|
|
|
|
CefRefPtr<CefClient>& client,
|
2021-06-17 21:43:06 +02:00
|
|
|
CefBrowserSettings& settings) override;
|
|
|
|
void Show(ShowMode mode) override;
|
|
|
|
void Hide() override;
|
|
|
|
void SetBounds(int x, int y, size_t width, size_t height) override;
|
|
|
|
void Close(bool force) override;
|
|
|
|
void SetDeviceScaleFactor(float device_scale_factor) override;
|
|
|
|
float GetDeviceScaleFactor() const override;
|
|
|
|
CefRefPtr<CefBrowser> GetBrowser() const override;
|
|
|
|
ClientWindowHandle GetWindowHandle() const override;
|
|
|
|
bool WithWindowlessRendering() const override;
|
2015-01-30 19:07:13 +01:00
|
|
|
|
|
|
|
// BrowserWindow::Delegate methods.
|
2024-04-17 18:01:26 +02:00
|
|
|
bool UseAlloyStyle() const override { return IsAlloyStyle(); }
|
2021-06-17 21:43:06 +02:00
|
|
|
void OnBrowserCreated(CefRefPtr<CefBrowser> browser) override;
|
|
|
|
void OnBrowserWindowDestroyed() override;
|
|
|
|
void OnSetAddress(const std::string& url) override;
|
|
|
|
void OnSetTitle(const std::string& title) override;
|
|
|
|
void OnSetFullscreen(bool fullscreen) override;
|
|
|
|
void OnAutoResize(const CefSize& new_size) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
void OnSetLoadingState(bool isLoading,
|
|
|
|
bool canGoBack,
|
2021-06-17 21:43:06 +02:00
|
|
|
bool canGoForward) override;
|
2015-04-24 15:48:32 +02:00
|
|
|
void OnSetDraggableRegions(
|
2021-06-17 21:43:06 +02:00
|
|
|
const std::vector<CefDraggableRegion>& regions) override;
|
2015-01-30 19:07:13 +01:00
|
|
|
|
2019-04-23 19:17:56 +02:00
|
|
|
void OnNativeWindowClosed();
|
2015-01-30 19:07:13 +01:00
|
|
|
|
2019-04-23 19:17:56 +02:00
|
|
|
private:
|
|
|
|
CefRefPtr<RootWindowMacImpl> impl_;
|
2015-01-30 19:07:13 +01:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(RootWindowMac);
|
2019-04-23 19:17:56 +02:00
|
|
|
|
|
|
|
friend class RootWindowMacImpl;
|
2015-01-30 19:07:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace client
|
|
|
|
|
2015-01-31 01:55:56 +01:00
|
|
|
#endif // CEF_TESTS_CEFCLIENT_BROWSER_ROOT_WINDOW_MAC_H_
|