mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-23 16:01:08 +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.*
66 lines
2.7 KiB
C++
66 lines
2.7 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_WIN_H_
|
|
#define CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_WIN_H_
|
|
|
|
#include <windows.h>
|
|
|
|
#include "libcef/browser/native/browser_platform_delegate_native_aura.h"
|
|
|
|
// Windowed browser implementation for Windows.
|
|
class CefBrowserPlatformDelegateNativeWin
|
|
: public CefBrowserPlatformDelegateNativeAura {
|
|
public:
|
|
CefBrowserPlatformDelegateNativeWin(const CefWindowInfo& window_info,
|
|
SkColor background_color);
|
|
|
|
// CefBrowserPlatformDelegate methods:
|
|
void BrowserDestroyed(CefBrowserHostBase* browser) override;
|
|
bool CreateHostWindow() override;
|
|
void CloseHostWindow() override;
|
|
CefWindowHandle GetHostWindowHandle() const override;
|
|
views::Widget* GetWindowWidget() const override;
|
|
void SendFocusEvent(bool setFocus) override;
|
|
void NotifyMoveOrResizeStarted() override;
|
|
void SizeTo(int width, int height) override;
|
|
gfx::Point GetScreenPoint(const gfx::Point& view) const override;
|
|
void ViewText(const std::string& text) override;
|
|
bool HandleKeyboardEvent(
|
|
const content::NativeWebKeyboardEvent& event) override;
|
|
CefEventHandle GetEventHandle(
|
|
const content::NativeWebKeyboardEvent& event) const override;
|
|
std::unique_ptr<CefFileDialogRunner> CreateFileDialogRunner() override;
|
|
std::unique_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner()
|
|
override;
|
|
std::unique_ptr<CefMenuRunner> CreateMenuRunner() override;
|
|
gfx::Point GetDialogPosition(const gfx::Size& size) override;
|
|
gfx::Size GetMaximumDialogSize() override;
|
|
|
|
// CefBrowserPlatformDelegateNativeAura methods:
|
|
ui::KeyEvent TranslateUiKeyEvent(const CefKeyEvent& key_event) const override;
|
|
gfx::Vector2d GetUiWheelEventOffset(int deltaX, int deltaY) const override;
|
|
base::TimeTicks GetEventTimeStamp() const override;
|
|
|
|
private:
|
|
static void RegisterWindowClass();
|
|
static LPCTSTR GetWndClass();
|
|
static LRESULT CALLBACK WndProc(HWND hwnd,
|
|
UINT message,
|
|
WPARAM wParam,
|
|
LPARAM lParam);
|
|
|
|
// True if the host window has been created.
|
|
bool host_window_created_ = false;
|
|
|
|
// Widget hosting the web contents. It will be deleted automatically when the
|
|
// associated root window is destroyed.
|
|
views::Widget* window_widget_ = nullptr;
|
|
|
|
bool has_frame_ = false;
|
|
bool called_enable_non_client_dpi_scaling_ = false;
|
|
};
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_WIN_H_
|