Commit Graph

852 Commits

Author SHA1 Message Date
amaitland 7eff7d17c0 ResourceHandler - Add new methods and callbacks
Now uses IResourceHandler.Open to call IResourceHandler.ProcessRequestAsync
IResourceHandler.ProcessRequestAsync now returns CefReturnValue instead of bool as there are three states
2019-06-25 19:24:57 +10:00
amaitland 4bf29cf358 IJavascriptCallback - Add ExecuteWithTimeoutAsync 2019-06-25 19:24:57 +10:00
amaitland 17d8767045 Revert "JavascriptCallback - Hack to work around upstream issue"
This reverts commit 9d47c2ed0f.
2019-06-25 19:24:57 +10:00
amaitland e2c7a3781c CefCookieAccessFilterAdapter - Add adapter and wire up CefResourceRequestHandlerAdapter
Cookie access can now be controlled using ICookieAccessFilter.CanSendCookie and ICookieAccessFilter.CanSaveCookie
- Remove ResourceHandlerWrapper::GetCookie as it's not used anymore
2019-06-25 19:24:57 +10:00
amaitland 5af8d77c46 CefResourceRequestHandlerAdapter - Deal with CefBrowser and CefFrame being null for ServiceWorker 2019-06-25 19:24:57 +10:00
amaitland da98060300 IResponse - Add Charset property
Maps to CefResponse::GetCharset and CefResponse::SetCharset
2019-06-25 19:24:57 +10:00
amaitland 3f820e4513 IRequest - Add GetHeaderByName and SetHeaderByName 2019-06-25 19:24:57 +10:00
amaitland 8fc2a37a30 JavascriptCallback - Hack to work around upstream issue
JavascriptCallback's are limited to only working in the main frame
Frame ids aren't the same between processes, so makes it almost impossible to handle callbacks in sub frames

https://bitbucket.org/chromiumembedded/cef/issues/2687/cefframe-getidentifier-differs-between
https://github.com/cefsharp/CefSharp/issues/2743#issuecomment-502566136

This should be reverted after the problem has been resolved.
2019-06-25 19:24:57 +10:00
amaitland 8ac2dc36d6 JavascriptCallbackProxy - Remove comment that's no longer relevant 2019-06-25 19:24:57 +10:00
amaitland ff87529a49 Javascript Legacy Binding - Pass objects on CefBrowserHost::CreateBrowser
Previously objects were sent in OnRenderViewReady, which is only called once for a browser instance, not for process switches
Now objects are passed when the browser is created, still need to check for popup handling
2019-06-25 19:24:57 +10:00
amaitland 0542c5138b SendProcessMessage - Remove frame/browserid from messages
Not complete or tested yet
2019-06-25 19:24:57 +10:00
amaitland 73a156fdc5 Initial version 75 upgrade and NetworkService changes
Compiles, that's about it at this point, there are major CEF breaking changes, and lots to be addressed.

Browser Process (main process)
- Removed IResourceHandlerFactory as it no longer fits with the structure that CEF provides
- New IResourceRequestHandler interface added, not plumbed in yet
- CefSettings - Add RootCachePath and ApplicationClientIdForFileScanning

BrowserSubprocess (render process)
- SendProcessMessage was moved from CefBrowser to CefFrame
- OnBrowserCreated added extraInfo param

The BrowserSubprocess changes for this upgrade should be complete
2019-06-25 19:24:57 +10:00
Alex Maitland 1a2c8ffcb6 Add CefSharp.PostMessage (#2799)
- JavascriptMessageReceived event added to ChromiumWebBrowser/IWebBrowser
- CefSharp.PostMessage and cefSharp.postMessage added to V8Context on creation for use in Javascript
- Add PostMessageTest.html
2019-06-03 21:08:03 +10:00
Alex Maitland 76e5a8d5c0 Add IAudioHandler (#2727)
* Feature Request - Add IAudioHandler

- For performance reasons we return NULL if no audiohandler is assigned
- No example is provided currently

Initial implementation for #2714
2019-05-03 12:54:40 +10:00
amaitland 335c884b08 Javascript Callback - Add additional tests
Add Basic tests, still need some more work.
Test changes added in #2748
2019-04-26 14:17:58 +10:00
amaitland c27524f456 IJavascriptCallback.CanExecute - Add checking for valid frame
Now checks if the frame associated with the callback still exists and if it's valid
Updated some of the QUnit tests to call CanExecute
2019-04-26 08:31:33 +10:00
amaitland 4ffaeb8cab IMPLEMENT_REFCOUNTING template changed - Add missing semi colon
Follow up to https://github.com/cefsharp/CefSharp/commit/8d70f836860d3d1bf1593afbae66bb60cfa737c7
(Seems I missed a few cases)

https://github.com/chromiumembedded/cef/commit/725ed88529d7542e64b9735cf0da137d8a80a8b9#diff-221201fe823e7238023e4e7f7083e26fL142
2019-04-26 07:32:01 +10:00
amaitland 8ced344ccd IBrowserHost - Add SendTouchEvent
- Includes Pen support

https://bitbucket.org/chromiumembedded/cef/commits/52d535a6dc4b8ec55c3aa7d6b6820e24f12516e8
https://bitbucket.org/chromiumembedded/cef/commits/7b5d30e9a92bacdcb81c60de19f1712aaf53ff74

Resolves #2663
2019-04-05 11:52:41 +10:00
amaitland a0d74dd63e IDisplayHandler - Add OnLoadingProgressChange
Resolves #2686
2019-03-27 22:05:17 +10:00
amaitland 45a79dc520 WPF/OffScreen - Add OnVirtualKeyboardRequested method
- Added to IRenderHandler in OffScreen
- Added to ChromiumWebBrowser in WPF (protected virtual, so inherit and override to implement)

Resolves #2689
2019-03-27 20:29:27 +10:00
Chris 12b27f91d5 Refactoring - Move CefNavigationEntry conversion to TypeConversion (#2682) 2019-03-23 13:15:50 +10:00
Alex Maitland 1a2d4a82f1 TypeConversion - Add null check to NavigationEntry^ FromNative
Also added extra comment to SslStatus
2019-03-23 13:13:34 +10:00
merceyz 58e8a29c77 Refactoring - Move CefNavigationEntry conversion to TypeConversion 2019-03-23 13:11:28 +10:00
amaitland 988c8ca263 IBrowserHost - Add SetAudioMuted and IsAudioMuted
Resolves #2665
2019-03-21 21:26:17 +10:00
amaitland 111439c98e CefSchemeRegistrar->AddCustomScheme - signature changed
https://bitbucket.org/chromiumembedded/cef/commits/cbcbd02638e5b4ccc26bab4a4b45b527c687068b?at=3683

Temp workaround until #2690 is implemented
2019-03-15 21:13:21 +10:00
amaitland 72ee102bcf V8Serialization - ConvertDateTimeToCefTime convert to UTC time
BindingTest.html - Add QUnit test

Resolves #2662
2019-02-28 20:27:06 +10:00
amaitland 34f29f0323 TypeConversion - Improve ToNative type checking when converting from Object to CefValue
Previously you had to used a fixed type, now the type checking is more flexible.

Move the Dictionary check to before the collection check as a dictionary is technically a collection

Resolves #2625
2019-01-18 12:34:25 +10:00
amaitland 406a2248b8 RequestContext - Throw exception of methods executed on Non CEF UI Thread
Resolves #2608
2019-01-17 08:07:15 +10:00
amaitland c02591116c RenderClientAdapter - Update GetViewRect to default to using width/height as 1 instead of 0 as CEF doesn't like 0
cefclient performs the same checks
2019-01-14 14:38:38 +10:00
amaitland d5a8108ed1 RequestContext.h - Split method implementation out into RequestContext.cpp
Also fix up some other includes that were broken as a result. Still a lot more code cleanup to do.
2019-01-10 07:07:28 +10:00
amaitland 1d65a8d07e VC++ - More header guards
See if I can reduce the number of errors in https://ci.appveyor.com/project/cefsharp/cefsharp/builds/21490716
2019-01-09 22:07:36 +10:00
amaitland 5854abea03 VC++ - Fix up includes and add some more header guards 2019-01-09 21:58:52 +10:00
Alex Maitland ce38ed81f0 Add IApp interface and DefaultApp implementation (#2616)
* Core - Add IApp interface and DefaultApp implementation

Move code from Cef.Initialize into CefSharpApp

Working towards #2139

* CefSharpApp.h - Allow CefCustomScheme->SchemeHandlerFactory to be null

If cefCustomScheme->SchemeHandlerFactory is null then we no longer attempt to call CefRegisterSchemeHandlerFactory
You can then choose which RequestContext you wish to register your handler for, no longer forcing you to register
in the global context

Remove null checks in OnScheduleMessagePumpWork as we're throwing an exception if they're null when the CefApp is created
2019-01-09 05:57:57 +10:00
Alex Maitland 02e3084af3 Add Chromium Extension Support (#2613)
* Add Chromium Extension Support

Add IRequestContext.LoadExtension
Add IExtensionHandler
Add IExtension
Add example (import from cefclient) - was added to CefSharp.WinForms.Example projct
Add RequestContextExtensions - to make loading an extension slightly easier
2018-12-31 13:12:10 +10:00
amaitland 2612c68002 Add IBrowserHost.RunFileDialog
Demo added to WinForms project

Resolves #2594
2018-12-28 13:39:33 +10:00
amaitland 9c742e0aac IBrowserHost.ImeSetComposition/ImeCommitText - Add ReplacementRange
IBrowserHost.ImeCommitText - Add relativeCursorPos

The CEF doc https://magpcss.org/ceforum/apidocs3/projects/(default)/CefBrowserHost.html says they should be optional params and only required on Mac OSX
Reports suggest they are required.

Resolves #2599
2018-12-27 21:14:36 +10:00
amaitland 11a8371e19 Rename CefExtension to V8Extension
Resolves #2612
2018-12-27 15:47:29 +10:00
amaitland bbf7795d80 WPF/OffScreen - Add OnAcceleratedPaint
Exposes the CEF API for Shared D3D11 Texture support. This should be considered experimental as there are quite a few known bugs in the CEF implementation
(PDF Viewer not working correctly)

OffScreen.ChromiumWebBrowser.CreateBrowser API changed (breaking change) now pass in `WindowInfo` to customise settings
Refactor CreateBrowser to support windowed and OSR rendering (now accepts IWindowInfo)

Resolves #2527
2018-12-16 19:37:12 +10:00
amaitland c618dc155b RenderClientAdapter.h - GetViewRect must return a CefRect
CEF API Change see https://bitbucket.org/chromiumembedded/cef/commits/09afa3a843531a1768896bed3f64fb49ed81b525?at=3578
2018-12-16 10:48:52 +10:00
Chris 98d7262987 Refactoring - Move CefCookie conversion to TypeConversion (#2597) 2018-12-13 10:59:05 +01:00
amaitland f938b24964 CefRequestContextHandlerAdapter - Remove stray double quote 2018-12-10 09:46:04 +10:00
amaitland cbd87dc7ce OnContextCreated/OnContextDestroyed - only continue if valid frame ptr
Follow up to #2563
2018-11-09 07:13:34 +10:00
Mitch Capper 921929484a Make sure frame is not null before accessing it (#2563)
closes #256
2018-11-09 07:09:39 +10:00
Alex Sukhovy 304a300b0c Call OnContextCreated and OnContextReleased for each frame (#2373)
* ContextEvents for each frame

* set CanExecuteJavascriptOnMainFrame

* example and comments

* whitespace fix

* comments

* whitespace

* update comments
2018-10-28 16:48:50 +10:00
amaitland 35414cac7a Scheme Handling - Don't attempt to register http or https schemes
http and https are built in schemes and don't need to be registered
Convert scheme name to lowercase
2018-10-09 20:26:15 +10:00
amaitland dcff3d0094 IJsDialogHandler - Rename OnJSBeforeUnload to OnBeforeUnloadDialog
Also fix xml doc

Resolves #2523
2018-09-25 20:56:31 +10:00
amaitland d136830443 CefApp::OnBeforeCommandLineProcessing - When value empty call AppendSwitch
Previously called AppendSwitchWithValue which fails now as it checks for a value

Resolves #2341
2018-09-23 20:30:22 +10:00
amaitland d8611436b3 V8Serialization - Combine if/else branches for enum serialization
Follow up to #2502
2018-09-23 20:02:39 +10:00
Wolfgang Kurz 0121b1c457 Enum serialization added to V8Serialization.cpp (#2502)
* Enum serialization added

* Revert codepage to 1252
2018-09-23 19:58:27 +10:00
amaitland 05b37ab615 ClientAdapter::OnBeforePopup - throw exception if return true and newBrowser != null
Hopefully this reduces the number of support requests
2018-09-15 19:46:54 +10:00