168 Commits

Author SHA1 Message Date
amaitland f04648ef11 Xml Doc - Add some more xml doc
Some of it's just placeholder doc to keep sandcastle happy
2018-09-05 09:51:22 +10:00
amaitland 8327adb18c OffScreen - ChromiumWebBrowser Fix xml doc 2018-08-24 19:16:51 +10:00
amaitland a373852e28 OffScreen - Untabify 2018-08-24 19:14:46 +10:00
amaitland ce7c152227 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:14:46 +10:00
Igor efdf9aa8d4 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-23 19:36:37 +10:00
amaitland 810f087dda CefSharp.OffScreen - Disable audio by default
It doesn't make much sense in an offscreen scenario
2018-08-12 15:17:53 +10:00
amaitland fe26853a57 WPF/OffScreen - Add missing ScreenInfo values
Change to using Rect struct

Follow up to #2474
2018-08-05 20:00:06 +10:00
amaitland 4fa411b34f WPF/OffScreen - Removed unneeded code 2018-08-05 20:00:05 +10:00
amaitland 366d3a898c 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:48:42 +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
amaitland d4ef1519b9 Add IRenderWebBrowser.GetScreenPoint - basic WPF implementation 2017-01-18 07:26:05 +10:00
amaitland fdd08896d7 Expose the IME methods/callback added with https://bitbucket.org/chromiumembedded/cef/commits/f7014be
It should now be possible for someone to implement IME support in the WPF control to resolve #1262
2016-12-14 07:32:03 +10:00
amaitland 79f3844cab Follow up to #1764
- Call SetHandlersToNull() in a consistent fashion across all three implementations
- Reword comments slightly
2016-08-09 12:40:58 +10:00
Alex Maitland d4feffb554 Feature - Add IBinder (#1749)
* Add basic ModelBinding which was imported from NancyFx framework - more can be stripped out that's unused

* Add IBinder as a param when registering an object for binding
Binding is disabled by default

* Add license and remove unused using statements

* Make bind method virtual to allow for overriding
Make methods protected

* Add very basic collection support - only primitive types supported for now.
Remove unused exceptions

* Support binding a list of sub objects

* Add null check for null params

* Add BindingOptions class - remove binder and CamelCaseJavascriptNames properties - allow for additional options in the future
Breaking change.

* Add support for List<object> binding type
2016-07-20 13:38:24 +10:00
amaitland a9661a73eb OffScreen - Allow for retrieval of main, popup or blended bitmap
Change methods to properties.
Add additional xml doc for new params
Rename variables and generally apply same style as rest of project
2016-07-06 21:56:51 +10:00
Valentin Deschaintre 910b56cbd3 Offscreen popup (dropdown list) merge with the background browser. (#1734)
* Enhanced implementation of offscreen ChromiumWebBrowser to enable more possibilities of override. Mainly improved the popup informations accessibility.

* Addition of a blending/merge implementation to set Bitmap to the whole image (full browser + popup) in case of dropdown lists in offscreen project. Fixed 2 comments.

* Remove the use of $"string {var}" for string.Format.

* Removal of "nameof" use.

* Move of the blending in ScreenshotOrNull for better performance. Removed useless function and variables. Samll fixes as asked in the PR.
2016-07-06 21:53:02 +10:00
amaitland 933bad3dcc Add a more detailed description of what thread events are executed on
Should be enough to generate some meaningful API docs now
2016-06-15 14:14:39 +10:00
amaitland afe758eb51 Use GhostDoc to generate bulk xml documentation - it's not perfect at least a lot of the interface doco has been copied into the
ChromiumWebBrowser instance classes
2016-06-15 13:44:16 +10:00
amaitland d1d754cf58 Remove CefWindowInfo from ClientAdapter::OnBeforePopup they will now need to be made in client code
(This is now possible as IWindowInfo exposes all the relevant pieces).
This will allow for a little more flexibility, specially on the WinForms front, it should be possible to create the control and then show the window later
2016-05-19 12:11:29 +10:00
amaitland 54f7fccdaa Upgrade to .Net 4.5.2
Resolve #1572
2016-05-10 20:28:21 +10:00
amaitland 60ae3cc739 Switch to using TrySetResult instead of SetResult
Invoke TrySetResult using TaskFactory.Run so continuations are run in an async fashion

Reference #1672
2016-04-27 21:01:58 +10:00
amaitland 81e909d772 OffScreen - Provide direct access to the underlying Bitmap (no locking or copying of the bitmap takes place). This maybe required in advanced scenarios
Add some additional doco to InvokeRenderAsync
2016-04-05 07:15:11 +10:00
amaitland af457916e3 Implement IFindHandler
Resolves #1459
2016-03-07 12:44:49 +10:00
amaitland f5248e7fec OffScreen - Dispose the framewrapper when done calling LoadUrl - was causing problems when trying to dispose quickly as the CefFrame reference was never released 2016-02-08 23:05:24 +10:00
amaitland 1c44c24f0e Add IsBrowserInitialized guard to OffScreen Size property - only called WasRezied when the browser has been initialized 2016-02-08 22:48:53 +10:00
amaitland 627f80c8ec Pass in only the required params into BrowserProcessServiceHost - was passing in the browser adapter which wasn't strictly required.
Pass the IBrowser instance into IWebBrowserInternal.OnAfterBrowserCreated
Keep a reference to IBrowser in the ChromiumWebBrowser instances (reduces the number of GetBrowser calls and also makes it clearer internally when the browser variable is set)
2016-01-12 14:01:37 +10:00