mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-03 12:37:36 +01:00
4fbd247231
This change adds support for: - Protocol and request handling. - Loading and navigation events. - Display and focus events. - Mouse/keyboard events. - Popup browsers. - Callbacks in the renderer process. - Misc. functionality required for ceftests. This change also adds a new CefBrowserProcessHandler::GetCookieableSchemes callback for configuring global state that will be applied to all CefCookieManagers by default. This global callback is currently required by the chrome runtime because the primary ProfileImpl is created via ChromeBrowserMainParts::PreMainMessageLoopRun (CreatePrimaryProfile) before OnContextCreated can be called. ProfileImpl will use the "C:\Users\[user]\AppData\Local\CEF\User Data\Default" directory by default (on Windows). Cookies may persist in this directory when running ceftests and may need to be manually deleted if those tests fail. Remaining work includes: - Support for client-created request contexts. - Embedding the browser in a Views hierarchy (cefclient support). - TryCloseBrowser and DoClose support. - Most of the CefSettings configuration. - DevTools protocol and window control (ShowDevTools, ExecuteDevToolsMethod). - CEF-specific WebUI pages (about, license, webui-hosts). - Context menu customization (CefContextMenuHandler). - Auto resize (SetAutoResizeEnabled). - Zoom settings (SetZoomLevel). - File dialog runner (RunFileDialog). - File and JS dialog handlers (CefDialogHandler, CefJSDialogHandler). - Extension loading (LoadExtension, etc). - Plugin loading (OnBeforePluginLoad). - Widevine loading (CefRegisterWidevineCdm). - PDF and print preview does not display. - Crash reporting is untested. - Mac: Web content loads but does not display. The following ceftests are now passing when run with the "--enable-chrome-runtime" command-line flag: CorsTest.* DisplayTest.*:-DisplayTest.AutoResize DOMTest.* DraggableRegionsTest.* ImageTest.* MessageRouterTest.* NavigationTest.* ParserTest.* RequestContextTest.*Global* RequestTest.* ResourceManagerTest.* ResourceRequestHandlerTest.* ResponseTest.* SchemeHandlerTest.* ServerTest.* StreamResourceHandlerTest.* StreamTest.* StringTest.* TaskTest.* TestServerTest.* ThreadTest.* URLRequestTest.*Global* V8Test.*:-V8Test.OnUncaughtExceptionDevTools ValuesTest.* WaitableEventTest.* XmlReaderTest.* ZipReaderTest.*
73 lines
2.6 KiB
C++
73 lines
2.6 KiB
C++
// Copyright 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.
|
|
|
|
#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"
|
|
|
|
// Base implementation of native browser functionality.
|
|
class CefBrowserPlatformDelegateNative
|
|
: public CefBrowserPlatformDelegateAlloy {
|
|
public:
|
|
// Used by the windowless implementation to override specific functionality
|
|
// when delegating to the native implementation.
|
|
class WindowlessHandler {
|
|
public:
|
|
// Returns the parent window handle.
|
|
virtual CefWindowHandle GetParentWindowHandle() const = 0;
|
|
|
|
// Convert from view coordinates to screen coordinates.
|
|
virtual gfx::Point GetParentScreenPoint(const gfx::Point& view) const = 0;
|
|
|
|
protected:
|
|
virtual ~WindowlessHandler() {}
|
|
};
|
|
|
|
// CefBrowserPlatformDelegate methods:
|
|
SkColor GetBackgroundColor() const override;
|
|
void WasResized() override;
|
|
|
|
// Translate CEF events to Chromium/Blink Web events.
|
|
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:
|
|
// Delegates that can wrap a native delegate.
|
|
friend class CefBrowserPlatformDelegateBackground;
|
|
friend class CefBrowserPlatformDelegateChrome;
|
|
friend class CefBrowserPlatformDelegateOsr;
|
|
friend class CefBrowserPlatformDelegateViews;
|
|
|
|
CefBrowserPlatformDelegateNative(const CefWindowInfo& window_info,
|
|
SkColor background_color);
|
|
|
|
// Methods used by delegates that can wrap a native delegate.
|
|
void set_windowless_handler(WindowlessHandler* handler) {
|
|
windowless_handler_ = handler;
|
|
set_as_secondary();
|
|
}
|
|
|
|
CefWindowInfo window_info_;
|
|
const SkColor background_color_;
|
|
|
|
WindowlessHandler* windowless_handler_; // Not owned by this object.
|
|
};
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_H_
|