184 Commits

Author SHA1 Message Date
campersau 6e82717f3f add spaces in exception messages (#2620) 2019-01-12 08:00:07 +10:00
amaitland 8c93b8bfbf OffScreen - Add CefSettings.EnableAudio
Just a helper method to remove the mute-audio command line arg
2019-01-12 06:39:42 +10:00
amaitland f9428c1aba OffScreen - BrowserSettings throw exception if attempting to use Disposed instance 2019-01-10 18:59:26 +10:00
amaitland ee7a7c2b34 OffScreen - Fill in missing xml doc
Hopefully this is the whole CefSharp.OffScreen namespaces now documented
2018-12-17 13:50:29 +10:00
amaitland 3cb5c119fa OffScreen - Remove obsolete methods
- Removed ChromiumWebBrowser methods OnPaint, OnCursorChange, StartDragging, UpdateDragCursor, OnPopupShow, OnPopupSize, OnImeCompositionRangeChanged
Access to that functionality is available through CefSharp.OffScreen.IRenderHandler, you can subclass the DefaultRenderHandler implementation should you require.
- Improve the xml doc for OnPaintEventArgs and some other methods

Resolves #2598
2018-12-17 13:41:05 +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 ccd721c98f OffScreen - Add xml doc to ChromiumWebBrowser.JavascriptObjectRepository property 2018-12-10 14:14:07 +10:00
amaitland 485297bb7f Fix some xml doc encoding issues 2018-11-19 13:22:45 +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 84e7a7d1de OffScreen - Improve IRenderHandler doco 2018-09-28 12:37:42 +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 4ab07c8a32 OffScreen - CefSettings remove command line args
OSR mouse scroll issue has been resolved.
2018-09-16 13:12:42 +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 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 b0af05a6ab OffScreen - ChromiumWebBrowser Fix xml doc 2018-08-24 19:17:25 +10:00
amaitland 13bafa709b OffScreen - Untabify 2018-08-24 19:13:59 +10:00
amaitland 8bc9e25e11 OffScreen - BitmapBuffer.CreateBitmap create new bitmap and copy buffer to it's back buffer
Bitmap was not a true snapshot of the image, the backbuffer being updated would change the image
2018-08-24 19:12:53 +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 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 e08e882c90 CefSharp.OffScreen - Disable audio by default
It doesn't make much sense in an offscreen scenario
2018-08-08 18:56:50 +10:00
amaitland a7c738456c WPF/OffScreen - Add missing ScreenInfo values
Change to using Rect struct

Follow up to #2474
2018-08-02 13:22:41 +10:00
amaitland ba8b9db4b5 WPF/OffScreen - Removed unneeded code 2018-08-02 13:22:26 +10:00
amaitland d87e795000 WinForms/Wpf/OffScreen - Create specific CefSettings class for each version
- This is a breaking change as there is no common `CefSharp.CefSettings`, there is no `CefSharp.Wpf.CefSettings`, `CefSharp.WinForms.CefSettings` and `CefSharp.OffScreen.CefSettings`
 - Cef.Initialize has been removed, the `ChromiumWebBrowser` constructor will call the `Cef.Initialize` with the defaults for your flavour
 - CefSettings.FocusedNodeChangedEnabled has been moved to CefSharpSettings.FocusedNodeChangedEnabled

Resolves #2477
2018-08-02 10:47:12 +10:00
amaitland 2f7618bf0e OffScreen - Remove BrowserSettings property
Can now only set BrowserSetting through the constructor or CreateBrowser method
BrowserSettings are only changeable before the browser has been created, this removes any confusion.
2018-07-18 19:38:11 +10:00
amaitland b779d2b567 OffScreen - Add xml doc comment to constructor
Add note about legacy binding and creating the browser
2018-07-12 20:35:52 +10:00
amaitland 2899112843 OffScreen - ScreenshotAsync now correctly passes through blend to ScreenshotOrNull 2018-06-27 21:51:53 +10:00
amaitland 90c5e71aeb WPF/OffScreen - Removed ViewRect and replaced with existing Rect (struct)
IRenderWebBrowser.GetViewRect didn't allow you to return the x and y coordinates

This is a breaking change
2018-06-27 19:54:41 +10:00
amaitland 2da7df0379 WPF/OffScreen - Initialize Cef with WindowlessRendering enabled by default
Suggestion is this is now required to be set

https://github.com/cefsharp/CefSharp/issues/2431
2018-06-27 18:57:11 +10:00
amaitland 0f6d70226e OffScreen - Simplify BitmapBuffer.ResizeBuffer
Was using Array.Resize to modify the existing array, unfortunately this doesn't yield the performance result the name implies.
A new array is created and copies elements from the old array, so performance is actually worse than allocating a new array.
For now we'll just create a new empty array.

https://msdn.microsoft.com/en-us/library/bb348051(v=vs.110).aspx
2018-05-17 14:22:40 +10:00
amaitland 9eb19756ac OffScreen - Default GetScreenPoint to the view x/y coordinates provided
This is likely a better default than 0, 0
2018-04-23 14:18:22 +10:00
amaitland d49f975f1c OffScreen - IRenderHandler now implements all methods
DefaultRenderHandler handles all the calls required by the OffScreen ChromiumWebBrowser implementation
2018-04-23 14:15:25 +10:00
amaitland c51a615d7d OffScreen - Add IRenderHandler and DefaultRenderHandler basic implementation
Only supports OnPaint, will expand to support the other methods
2018-04-23 13:02:12 +10:00
amaitland 61033e66c8 WPF/OffScreen cleanup
- More code cleanup, use null-propagating operator
- WPF Add protected virtual UpdateDragCursor
2018-04-23 12:42:00 +10:00
amaitland c1b89c62e9 WPF/OffScreen - Code cleanup and minor refactor
IRenderWebBrowser - Method naming now matches CEF, xmldoc updated to be more accurate

CefSharp.Wpf.ChromiumWebBrowser and CefSharp.OffScreen.ChromiumWebBrowser both updated as a result of IRenderWebBrowser changes
Should be minimal public API changes, should only require changes for those that are implementing their own rendering, who will have a major rewrite on their hands regardless of this.
2018-04-20 14:49:25 +10:00
amaitland d99d6d87fe Set event handlers to null in Dispose
Not all event handlers were set to null on Dispose in ChromiumWebBrowser instances and JavascriptObjectRepository

Resolves #2307
2018-04-13 16:18:57 +10:00
amaitland c37dbcd06a Remove Geolocation API and Upgrade version numbers to 65 2018-03-17 21:31:25 +10:00
amaitland efc77d4fcc Fix typo 2018-01-22 11:03:49 +10:00
Alex Maitland 9b01b69d2f Implement Javascript Binding v2 (#2247)
* JSB Rewrite - Add CefSharp.RegisterBoundObject javascript method

To get around the problem of IPC timing, I've reversed the communication, now it's the render process requesting
the bound objects, the implementation is incomplete at this stage, more just a basic proof of concept

Rewrite BindingTest.html using QUnit
One of the tests doesn't map correctly as it requires def user interaction

TODO:

- Get objects by name
- Rename Messages.h values that relate to this change so they are more descriptive
- Better error handling
- Caching of objects within a render process
- Investigate global context options, don't think it's possible to call an async method directly in the global context

# Conflicts:
#	CefSharp.Example/Resources/BindingTest.html

* JSB Improve Request/Response message names

* BindingTest.html - Output stress test results

* Remove JavascriptRootObject was leftover from time we used WCF to transmit objects

* JavascriptObjectRepository - Objects are now sent in the same list with an IsAsync flag

Separation when sending over IPC with two unique lists isn't necessary

* JavascriptObjectRepository - Return objects by name or return all by default

Untabify CefAppUnmanagedWrapper.cpp
Add minor comment to CefBrowserWrapper for a reminder that we use Frame Identifier as dictionary key

* Add //TODO: JSB comments for work that's left to be done

Ideally within a render process we cache bound objects once they've been communicated,
It would also be nice to make multiple binding requests so objects can later be added dynamically

* JSB Allow multiple calls to CefSharp.RegisterBoundObject

Update BindingTest.html to name two distinct calls to different bound objects

* JSB - Add some notes about caching, no working implementation yet

* JSB - Dynamically Register object on Request

* JSB Add ability to unbind an object and rename RegisterBoundObject to BindObjectAsync

# Conflicts:
#	CefSharp.Example/Resources/BindingTest.html

* JSB BindObjectAsync - if objects already bound then return false

* JSB - Ignore Indexer properties

Were previously throwing an exception

* JSB - Add LegacyJavascriptBindingEnabled option so preserve existing behaviour

This is only useful for SPA application and those that only navigate to pages
hosting within a single domain. Any sort of cross-site navigation and a new
render process will be spawned and objects won't be bound automatically
(You can use the new methods to request they're bound yourself, at least in theory,
more testing required on this)

* Add LegacyBindingTest.html

Current disabled by default. To enable uncomment CefSharpSettings.LegacyJavascriptBindingEnabled = true;
in CefExample.cs

* RegisterJsObject and RegisterAsyncJsObject can now only be used when CefSharpSettings.LegacyJavascriptBindingEnabled = true

See https://github.com/cefsharp/CefSharp/issues/2246 for details
2018-01-22 10:24:25 +10:00
amaitland 127c00554f Rewrite WPF/OffScreen OnPaint
OffScreen
  - Now maintains a raw Byte[] buffer that is used to create the GDI bitmaps
can be overridden and raw buffer access granted (eliminates the forced memory copy to the memory mapped view)

WPF
  - MemoryMappedFile.CreateNew is now used to create the in memory view and copy the buffer
  - InteropBitmapFactory only create new MemoryMappedFile selectively. If the MemoryMappedFile is larger than we require then just reuse it rather than
    releasing then allocating a smaller section of memory that's used for double buffering with InteropBitmap and WritableBitmap
  - Removed CefDirtyRect and used existing Rect class
  - Rename rendering event to Paint, still preferable to implement IBitmapFactory or subclass ChromiumWebBrowser
  - Update ChromiumWebBrowserWithScreenshotSupport to support new rendering method - not very well tested.

Resolves #2237
2018-01-18 11:29:12 +10:00
amaitland 564dd4da73 CefDirectRect was removed, replace with Rect 2018-01-18 10:25:54 +10:00
amaitland 4e0fb684fe OffScreen - code cleanup and expose more of the underlying methods, allow for overriding of IRenderWebBrowser method when inheriting from ChromiumWebBrowser
Mark ScreenshotOrNull as obsolete - use OnPaint instead
Mark NewScreenshot event as obsolete - use ScreenshotAsync instead
2018-01-18 10:25:51 +10:00
amaitland d585348887 Add RequestContext getter property to IWebBrowser
WPF - Add checks so if RequestContext is set after browser created an exception is thrown
WinForms - Add checks so if RequestContext is set after browser created an exception is thrown
2017-12-20 12:26:49 +10:00
amaitland c2891c5d1e Add protected virtual methods for the most common IRenderWebBrowser methods that users would need to override.
Still maintain the explicit interface methods - prefer the additional compiler checks and readability
Rename IRenderWebBrowser.InvokeRenderAsync to OnPaint - keeps inline with CEF naming
Added better comments to IRenderWebBrowser.OnPaint
2017-05-29 13:33:50 +10:00
amaitland eecf3aded9 Add IWebBrowser.CanExecuteJavascriptInMainFrame property, set to true/false when V8Context is created/released
Added checks in the execute/eval javscript methods in WebBrowserExtensions
Made possibly by the addition of OnContextReleased IPC message being added
2017-03-28 09:43:59 +10:00
amaitland b432d5aa38 Change IBrowserHost.SendMouse* to use the MouseEvent struct (added some extension methods to maintain API compatibility)
Review classes and structs
Added constructor to structs where all fields were required
Made some classes sealed, mostly those that are passed into the framework where subclassing and adding methods/properties wouldn't make sense
2017-03-27 15:46:34 +10:00
amaitland 3bc9ca1898 Move Enums into their own folder (again not changing the namespace as to avoid breaking the public API, at least for now)
Add copyright disclaimer to JavascriptResponse
Remove Kernel32.OutputDebugString calls and replace with Debug.WriteLine
Removed ScriptException and ResponseAction - unused classes
Rename CefCursorType to CursorType - wasn't exposed as part of the public API so can rename
2017-03-21 10:05:38 +10:00
Chris cd934267c6 Updated copyright year and made sure it used same format everywhere (#1966) 2017-03-06 08:44:37 +10:00
amaitland 84930b0784 Update sandcastle help file version numbers to 55.0.0
Fix some other xml comments and remove some unused fields - still lots of comments that could be added
2017-02-06 15:00:45 +10:00