From f612d0e468a02647a6787ba7610e524cd1802fbe Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Thu, 18 Jul 2013 22:14:39 +0300 Subject: [PATCH] Updated to CEF3/Chromium 27. I think we have most of it covered now, as far as the header file goes, except for OnBeforeBrowse and OnResourceResponse. I have no idea what these correspond to with CEF3 so we will have to check if up with Marshall et al. --- CefSharp/ClientAdapter.h | 63 ++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/CefSharp/ClientAdapter.h b/CefSharp/ClientAdapter.h index 1fab09632..30260484e 100644 --- a/CefSharp/ClientAdapter.h +++ b/CefSharp/ClientAdapter.h @@ -1,7 +1,13 @@ +// Copyright © 2010-2013 The CefSharp Project. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + #include "Stdafx.h" #pragma once +#include "include/cef_app.h" #include "include/cef_client.h" +#include "include/cef_render_process_handler.h" namespace CefSharp { @@ -9,16 +15,18 @@ namespace CefSharp interface class IWebBrowser; - class ClientAdapter : public CefClient, - public CefLifeSpanHandler, - public CefLoadHandler, - public CefRequestHandler, - public CefDisplayHandler, - public CefV8ContextHandler, - public CefMenuHandler, - public CefFocusHandler, - public CefKeyboardHandler, - public CefJSDialogHandler + class ClientAdapter : + public CefClient, + public CefLifeSpanHandler, + public CefLoadHandler, + public CefRequestHandler, + public CefDownloadHandler, + public CefDisplayHandler, + public CefRenderProcessHandler, + public CefContextMenuHandler, + public CefFocusHandler, + public CefKeyboardHandler, + public CefJSDialogHandler { private: gcroot _browserControl; @@ -39,53 +47,52 @@ namespace CefSharp virtual CefRefPtr GetLoadHandler() OVERRIDE { return this; } virtual CefRefPtr GetRequestHandler() OVERRIDE { return this; } virtual CefRefPtr GetDisplayHandler() OVERRIDE { return this; } - virtual CefRefPtr GetV8ContextHandler() OVERRIDE { return this; } - virtual CefRefPtr GetMenuHandler() OVERRIDE { return this; } + virtual CefRefPtr GetDownloadHandler() OVERRIDE; + virtual CefRefPtr GetContextMenuHandler() OVERRIDE { return this; } virtual CefRefPtr GetFocusHandler() OVERRIDE { return this; } virtual CefRefPtr GetKeyboardHandler() OVERRIDE { return this; } virtual CefRefPtr GetJSDialogHandler() OVERRIDE { return this; } // CefLifeSpanHandler - virtual DECL bool OnBeforePopup(CefRefPtr parentBrowser, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, const CefString& url, CefRefPtr& client, CefBrowserSettings& settings) OVERRIDE; + virtual DECL bool OnBeforePopup(CefRefPtr browser, CefRefPtr frame, + const CefString& target_url, const CefString& target_frame_name, const CefPopupFeatures& popupFeatures, + CefWindowInfo& windowInfo, CefRefPtr& client, CefBrowserSettings& settings, bool* no_javascript_access) OVERRIDE; virtual DECL void OnAfterCreated(CefRefPtr browser) OVERRIDE; virtual DECL void OnBeforeClose(CefRefPtr browser) OVERRIDE; // CefLoadHandler virtual DECL void OnLoadStart(CefRefPtr browser, CefRefPtr frame) OVERRIDE; virtual DECL void OnLoadEnd(CefRefPtr browser, CefRefPtr frame, int httpStatusCode) OVERRIDE; - virtual DECL bool OnLoadError(CefRefPtr browser, CefRefPtr frame, ErrorCode errorCode, const CefString& failedUrl, CefString& errorText) OVERRIDE; + virtual DECL void OnLoadError(CefRefPtr browser, CefRefPtr frame, ErrorCode errorCode, const CefString& errorText, const CefString& failedUrl) OVERRIDE; // CefRequestHandler - virtual DECL bool OnBeforeBrowse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, NavType navType, bool isRedirect) OVERRIDE; - virtual DECL bool OnBeforeResourceLoad(CefRefPtr browser, CefRefPtr request, CefString& redirectUrl, CefRefPtr& resourceStream, CefRefPtr response, int loadFlags) OVERRIDE; - virtual DECL void OnResourceResponse(CefRefPtr browser, const CefString& url, CefRefPtr response, CefRefPtr& filter) OVERRIDE; - virtual DECL bool GetDownloadHandler(CefRefPtr browser, const CefString& mimeType, const CefString& fileName, int64 contentLength, CefRefPtr& handler) OVERRIDE; - - virtual DECL bool GetAuthCredentials(CefRefPtr browser, bool isProxy, const CefString& host, int port, const CefString& realm, const CefString& scheme, CefString& username, CefString& password) OVERRIDE; + virtual DECL bool OnBeforeResourceLoad(CefRefPtr browser, CefRefPtr frame, CefRefPtr request) OVERRIDE; + virtual DECL bool GetAuthCredentials(CefRefPtr browser, CefRefPtr frame, bool isProxy, + const CefString& host, int port, const CefString& realm, const CefString& scheme, CefRefPtr callback) OVERRIDE; // CefDisplayHandler virtual DECL void OnAddressChange(CefRefPtr browser, CefRefPtr frame, const CefString& url) OVERRIDE; - virtual DECL void OnContentsSizeChange(CefRefPtr browser, CefRefPtr frame, int width, int height) OVERRIDE; virtual DECL void OnTitleChange(CefRefPtr browser, const CefString& title) OVERRIDE; virtual DECL bool OnTooltip(CefRefPtr browser, CefString& text) OVERRIDE; virtual DECL bool OnConsoleMessage(CefRefPtr browser, const CefString& message, const CefString& source, int line) OVERRIDE; - // CefV8ContextHandler + // CefRenderProcessHandler virtual DECL void OnContextCreated(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) OVERRIDE; - // CefMenuHandler - virtual DECL bool OnBeforeMenu(CefRefPtr browser, const CefMenuInfo& menuInfo) OVERRIDE; + // CefContextMenuHandler + virtual DECL void OnBeforeContextMenu(CefRefPtr browser, CefRefPtr frame, + CefRefPtr params, CefRefPtr model) OVERRIDE; // CefFocusHandler virtual DECL void OnTakeFocus(CefRefPtr browser, bool next) OVERRIDE; // CefKeyboardHandler - virtual DECL bool OnKeyEvent(CefRefPtr browser, KeyEventType type, int code, int modifiers, bool isSystemKey, bool isAfterJavaScript) OVERRIDE; + virtual DECL bool OnKeyEvent(CefRefPtr browser, const CefKeyEvent& event, CefEventHandle os_event) OVERRIDE; // CefJSDialogHandler - virtual DECL bool OnJSAlert(CefRefPtr browser, CefRefPtr frame, const CefString& message) OVERRIDE; - virtual DECL bool OnJSConfirm(CefRefPtr browser, CefRefPtr frame, const CefString& message, bool& retval) OVERRIDE; - virtual DECL bool OnJSPrompt(CefRefPtr browser, CefRefPtr frame, const CefString& message, const CefString& defaultValue, bool& retval, CefString& result) OVERRIDE; + virtual bool OnJSDialog(CefRefPtr browser, const CefString& origin_url, const CefString& accept_lang, + JSDialogType dialog_type, const CefString& message_text, const CefString& default_prompt_text, + CefRefPtr callback, bool& suppress_message) OVERRIDE; IMPLEMENT_LOCKING(ClientAdapter); IMPLEMENT_REFCOUNTING(ClientAdapter);