#ifndef CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_H_
#define CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_H_
#include "libcef/browser/alloy/browser_platform_delegate_alloy.h"
class CefBrowserPlatformDelegateNative
: public CefBrowserPlatformDelegateAlloy {
public:
class WindowlessHandler {
public:
virtual CefWindowHandle GetParentWindowHandle() const = 0;
virtual gfx::Point GetParentScreenPoint(const gfx::Point& view) const = 0;
protected:
virtual ~WindowlessHandler() {}
};
SkColor GetBackgroundColor() const override;
void WasResized() override;
virtual content::NativeWebKeyboardEvent TranslateWebKeyEvent(
const CefKeyEvent& key_event) const = 0;
virtual blink::WebMouseEvent TranslateWebClickEvent(
const CefMouseEvent& mouse_event,
CefBrowserHost::MouseButtonType type,
bool mouseUp,
int clickCount) const = 0;
virtual blink::WebMouseEvent TranslateWebMoveEvent(
const CefMouseEvent& mouse_event,
bool mouseLeave) const = 0;
virtual blink::WebMouseWheelEvent TranslateWebWheelEvent(
const CefMouseEvent& mouse_event,
int deltaX,
int deltaY) const = 0;
const CefWindowInfo& window_info() const { return window_info_; }
protected:
friend class CefBrowserPlatformDelegateBackground;
friend class CefBrowserPlatformDelegateChrome;
friend class CefBrowserPlatformDelegateOsr;
friend class CefBrowserPlatformDelegateViews;
CefBrowserPlatformDelegateNative(const CefWindowInfo& window_info,
SkColor background_color);
void set_windowless_handler(WindowlessHandler* handler) {
windowless_handler_ = handler;
set_as_secondary();
}
CefWindowInfo window_info_;
const SkColor background_color_;
WindowlessHandler* windowless_handler_;
};
#endif