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
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "include/base/cef_scoped_ptr.h"
|
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.
|
|
|
|
RootWindowMac();
|
|
|
|
~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,
|
2017-08-04 00:55:19 +02:00
|
|
|
const RootWindowConfig& config,
|
|
|
|
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,
|
|
|
|
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;
|
2015-08-10 22:49:45 +02:00
|
|
|
void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE;
|
|
|
|
float GetDeviceScaleFactor() const OVERRIDE;
|
2015-01-30 19:07:13 +01:00
|
|
|
CefRefPtr<CefBrowser> GetBrowser() const OVERRIDE;
|
|
|
|
ClientWindowHandle GetWindowHandle() const OVERRIDE;
|
2017-08-04 00:55:19 +02:00
|
|
|
bool WithWindowlessRendering() const OVERRIDE;
|
|
|
|
bool WithExtension() const OVERRIDE;
|
2015-01-30 19:07:13 +01:00
|
|
|
|
|
|
|
// BrowserWindow::Delegate methods.
|
|
|
|
void OnBrowserCreated(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
|
|
|
void OnBrowserWindowDestroyed() OVERRIDE;
|
|
|
|
void OnSetAddress(const std::string& url) OVERRIDE;
|
|
|
|
void OnSetTitle(const std::string& title) OVERRIDE;
|
2015-06-05 00:33:24 +02:00
|
|
|
void OnSetFullscreen(bool fullscreen) OVERRIDE;
|
2017-08-04 00:55:19 +02:00
|
|
|
void OnAutoResize(const CefSize& new_size) OVERRIDE;
|
2015-01-30 19:07:13 +01:00
|
|
|
void OnSetLoadingState(bool isLoading,
|
|
|
|
bool canGoBack,
|
|
|
|
bool canGoForward) OVERRIDE;
|
2015-04-24 15:48:32 +02:00
|
|
|
void OnSetDraggableRegions(
|
|
|
|
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_
|