Commit Graph

741 Commits

Author SHA1 Message Date
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
Michael Olsen ae94efa7df WPF Experimental - Fixed IME window not showing or showing at the wrong location (#2782)
* Fixed IME window not showing at all or sometimes showing at the wrong location.

* Added braces for code consistency.

* Added a few more braces for code consistency.

* Removed unnecessary local variable.

* Removed some implementation specific wording in a comment.
2019-05-31 07:22:31 +10:00
Alex Maitland 002edfb058 WPF - Add IME Support (#2757)
* WPF - Add initial IME implementation

* WPF - WpfImeKeyboardHandler handler code cleanup

- Restructure ImeHandler to be a static class as it really didn't maintain any state, now hwnd is passed in as param
- Renamed many of the methods to Ime for consistency (IME in all caps doesn't patch the naming convention used)
- The WpfIMEKeyboardHandler implementation is pretty much self contained now, only a single reference in ChromiumWebBrowser
also moved into Experimental folder/namespace
2019-05-04 12:32:38 +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 d8d392dff3 WPF - Make PartImageName/PartImagePopup name consts public for external use 2019-04-30 13:16:54 +10:00
amaitland 3d14f19867 WPF - Add Experimental ChromiumWebBrowserWithTouchSupport
Based on #2745

Original author https://github.com/GSonofNun
2019-04-26 08:14:45 +10:00
GSonofNun b5ee1e0beb WPF - Add TemplatePart Attributes to ChromiumBrowser (#2739) 2019-04-25 08:18:59 +10:00
amaitland cddece0cdc WPF - Add VirtualKeyboardRequested and corresponding VirtualKeyboardRequestedEventArgs 2019-04-06 11:48:33 +10:00
amaitland ea843f31c1 Formatting fixes
Follow up to #2691
2019-04-05 12:02:02 +10:00
João Neves 6692749728 WPF - Implement UpdateDragCursor (#2691)
* Close cefsharp subprocess if main process dies

* Implemented UpdateDragCursor

* Fixed braces position

* Added license header

* Fixed cursor flickering

* Added test

* Fixed build

* Fixed move cursor

* Fixed braces

* Simplified solution

* Fixed dropping Link effect

* Fixed encoding + Removed leftovers
2019-04-05 11:58:27 +10:00
amaitland dfb2cd55f1 WPF - Add ChromiumWebBrowser constructor overload with initialAddress param
Allows for address to be passed directly to CefBrowserHost::CreateBrowser which is required for CefExtension support

Resolves #2645
2019-04-05 11:56:45 +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
Alex Maitland c3bbd37cce Reorder dispose pattern in ChromiumWebBrowser (#2701)
* WinForms/Wpf/OffScreen - Reorder Dispose methods

- Set browser initialized to false
- Release event handlers
- Dispose managedCefBrowserAdapter
- Set handlers to null

* WinForms/WPF/OffScreen - Set Handlers to null immediately after event handlers cleared

The one exception is LifeSpanHandler which is released after managedCefBrowserAdapter.Dispose
2019-03-26 20:14:13 +10:00
Chris 987f988dac Refactoring - Moved RegisterJsObject and RegisterAsyncJsObject to WebBrowserExtensions (#2703) 2019-03-23 13:31:09 +10:00
Chris 86b2d8cecd Improved dispose pattern in ChromiumWebBrowser (#2651)
* Code Cleanup - Improved ChromiumWebBrowser Dispose/Finalise

* Added thread safe dispose pattern
* Added IsDisposed

* Wpf - Cleanup and improvements to the dispose pattern

* WinForms - Cleanup and improvements to the dispose pattern

* OffScreen - Cleanup and improvements to the dispose pattern

* Added IsDisposed to IWebBrowser

* Fixed comments

* WinForms - Removed Finalizer and Dispose()

* WPF - ChromiumWebBrowser.Dispose add comment for Interlocked.CompareExchange

* WinForms - ChromiumWebBrowser.Dispose add comment for Interlocked.CompareExchange
2019-03-22 21:49:02 +10:00
amaitland d2d1e6f879 WPF/WinForms/OffScreen - Move BrowserSettings Dispose into ManagedCefBrowserAdapter::CreateBrowser
- Improve BrowserSettings disposed check message

Follow up to #2643
2019-03-22 10:46:54 +10:00
amaitland 3423670740 WinForms/WPF/OffScreen - Dispose of BrowserSettings only if created by CefSharp framework
- Add OffScreen project to internals visible to list for CefSharp.Core
- Add BrowserSettings.FrameworkCreated property which can only be set through an internal constructor
- Dispose of BrowserSettings immediately after call to CreateBrowser if created by CefSharp framework
- managedCefBrowserAdapter::CreateBrowser  throw exception if browserSettings already disposed

Resolves #2643
2019-03-21 20:13:02 +10:00
amaitland 1c5d4000fa WinForms/WPF - Dispose of IFrame after calling LoadUrl 2019-03-18 20:11:48 +10:00
amaitland 4a145bf363 WPF ByteArrayWritableBitmapRenderHandler - Remove base class
AbstractRenderHandler - change pixel properties to internal so they can be shared ByteArrayWritableBitmapRenderHandler
WritableBitmapRenderHandler - run Format Document (changed fields to read only)

Follow up to #2652
2019-03-01 13:19:35 +10:00
Chris 5c292cd707 WPF - Refactor RenderHandler implementations (#2652)
* WPF - Refactored the RenderHandler implementations

* Added a AbstractRenderHandler
* Refactored the RenderHandlers to inherit from AbstractRenderHandler
* Implemented the correct and thread safe dispose pattern

* WPF - AbstractRenderHandler updated xml documentation

* WPF - ByteArrayWritableBitmapRenderHandler: Removed incorrect PixelFormat

* WPF - AbstractRenderHandler: Added missing GC.SuppressFinalize
2019-03-01 13:03:52 +10:00
Chris 8d23dc711b WPF - Fix compile error because of IDE1006 Naming rule violation (#2649) 2019-02-13 21:19:23 +01:00
amaitland 2c9155f1cb WinForms/WPF - Change browserSettings to use the private field to avoid throw exception in dispose
- Changed to expose only the public interface (this is better for scenarios where the designer attempts to query the property and subsequently attempts to load libcef and fails).
- Make IBrowserSettings implement IDisposable
- ManagedCefBrowserAdapter::CreateBrowser now throws exception if browserSettings param is null

The WPF version won't actually throw an exception, just standardised it's code so they're both the same.

Issue #2638
2019-02-08 10:14:32 +10:00
campersau b31069633e add spaces in exception messages (#2620) 2019-01-11 08:57:28 +10:00
amaitland fa0a05793d WPF - BrowserSettings dispose after browser created
Additionally throw exception if BrowserSettings set after BrowserCreated
2019-01-09 19:53:35 +10:00
amaitland a1ccca77b8 WPF - Keyboard handlers make Dispose/Setup methods virtual
Allows for extension of the existing keyboard handler
2018-12-27 21:45:03 +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
amaitland 5493b1381f WPF - CefSettings Add disable-threaded-scrolling (commented out)
Setting disable-threaded-scrolling as the default when using OSR is something I'm considering
2018-12-10 09:46:03 +10:00
maloshuk 5622809d68 WPF - Change PixelFormat from Bgra32 to Pbgra32 to fix control transparency (#2589)
* WPF - set PixelFormats.Pbgra32 for all rendering methods #2127
2018-12-07 19:42:54 +10:00
Chris 0df677a509 WPF - Use nameof for DependencyProperty.Register instead of hardcoded strings (#2585)
* WPF - Use nameof for DependencyProperty.Register instead of hardcoded strings

* WPF - Trimmed whitespace
2018-12-03 22:07:55 +10:00
amaitland a10a5ef897 WPF - ChromiumWebBrowser.GetScreenInfo provide Rect and AvailableRect
Get monitor info based on handle (hwnd).

It's unclear if the coordinates need to be dpi scaled, revisit later if they do
2018-10-29 20:13:02 +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 9c73df0dce WPF - Mouse Scrollbar usability
Send only the mouseUp when leaving, no mouse Move like before, the scrolling behaviour has changes slightly in version 69.

Issue #2258
2018-09-30 15:22:54 +10:00
amaitland 1b39c2a70a WinForms/WPF/OffScreen - Cleanup some xml doc around BrowserInitialized event
Probably still needs some work, would be nice if the event was the same in all three instances, difficult with the WPF version being a DependencyPropertyChangedEventHandler
2018-09-27 22:02:00 +10:00
Chris 30ee538ce0 Added EditorConfig (#2514) 2018-09-17 00:46:21 +02:00
amaitland 55d31a27db Wpf CefSettings - Remove TouchpadAndWheelScrollLatching disabled feature
Should officially resolve #2408
2018-09-10 13:00:07 +10:00
Chris bef5dd37c4 Maintenance - Fixed formatting, file encoding, and copyright year (#2504)
* Applied formatting

* Fixed file encoding + Updated copyright year

* Updated License

* Fixed more file encoding

* Copyright notice now shows the year the file was created
2018-09-10 10:41:13 +10:00
amaitland 28f43261b6 Xml Doc - Add more comments and fixes 2018-09-05 13:02:43 +10:00
amaitland 8ed2681619 Xml Doc - Add some more xml doc
Some of it's just placeholder doc to keep sandcastle happy
2018-09-05 13:01:41 +10:00
amaitland 54c625c57b WPF - Tooltip Wrap
Wrap the tooltip content in a text block, so that it gets wrapped (was previously going off screen)

Related to #2488
2018-09-04 19:41:37 +10:00
amaitland d1d4f1b2b8 WPF - CreateOffscreenBrowser called with null Address
Workaround for #2300
2018-08-23 19:34:21 +10:00
amaitland bbcb10c77f Wpf ChromiumWebBrowser - Remove unused code and usings 2018-08-16 19:47:21 +10:00
Damir Ainullin fc373f4601 Fixed small typo and removed excessive null-check (#2485) 2018-08-16 19:44:40 +10:00
Igor 0ede12e7ba Add OSR AccessiblityHandler. (#2480)
* Add AccessibilityHander.

Implement CefAccessibilityHandler. Add IAccessibilityHandler interface. Add AccessibilityHandler field to IWebBrowser.

* Pull request fixes.

Replaces tabs with spaces; move CefAccessibilityHandler implementation to RenderClientAdapter; add missing comments.

* Add CefValueWrapper.

Add ICefValue interface; pass ICefValue to IAccessibilityHandler.

* Pull request fixes.

Rename CefValue to Value and CefValueType to ValueType; add CefValueWrapper::GetObject() method; remove stub code in AccessibilityHandler; fix comment on IAccessibilityHandler.

* Pull request fixes.

Fix comments for IValue; remove redundant global namespace reference for CefValueType.
2018-08-16 19:33:02 +10:00
amaitland 0abf95be0b Revert "WPF - Capture mouse when left button down so scrollbar works correctly outside of browser"
This reverts commit c843317e33.
2018-08-13 20:26:05 +10:00
amaitland 20b064cef2 Remove unused code
Follow up to #2239
2018-08-13 19:28:01 +10:00
amaitland 5a469d4a15 WPF/OffScreen - OSR rendering now supports surface sync
Remove the disabled-features SurfaceSynchronization command arg
Remove RootLayerScrolling command line arg (causes strange scrolling behaviour)

https://bitbucket.org/chromiumembedded/cef/issues/2447/osr-add-support-for-surface
2018-08-13 19:19:14 +10:00
amaitland 61e94115d8 Wpf - SetPopupSizeAndPositionImpl rect values appear to already be prescaled (highdpi)
Change to using Canvas.SetLet and Canvas.SetTop helper methods
2018-08-02 18:30:19 +10:00
amaitland 308603e788 Merge branch 'wpf/basecontrolandpopupchange' of https://github.com/amaitland/CefSharp 2018-08-02 18:23:04 +10:00