357 Commits

Author SHA1 Message Date
Chris 20bd345865 WinForms: Prevent designer from setting any default values (#2265) 2018-02-06 09:24:14 +10:00
amaitland 980b9fe7f3 WinForms - Temp workaround for a bug where the address passed into the constructor isn't always loading 2018-02-06 09:24:13 +10:00
Chris c39e288c42 WinForms: Prevent designer from setting default values (#2261) 2018-02-06 09:24:12 +10:00
Chris 4f2a10c8b1 Revert build breaking change (#2262) 2018-02-06 09:24:11 +10:00
amaitland 9139b164f9 WinForms - Add custom Designer
Add some custom designer attributes
Converted the logo.png to a 16x16 bmp as a short term placeholder (someone is welcome to contribute something better)
Hide all the handlers from the designer
2018-02-06 09:24:11 +10:00
amaitland 7cd0eb1991 Fix typo 2018-01-22 11:33:11 +10:00
Alex Maitland 44fdfa94c8 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 11:33:09 +10:00
amaitland fc85278f76 WinForms - If the ChromiumWebBrowser has it's handle recreated then in OnHandleCreated we will now attempt to reparent a existing instance rather than creating a new browser
# Conflicts:
#	CefSharp.WinForms/ChromiumWebBrowser.cs
2018-01-22 11:32:23 +10:00
amaitland 93a329bc7a WinForms/WPF Fix incorrect type check when setting RequestContext 2017-12-20 12:26:50 +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 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
Chris cd934267c6 Updated copyright year and made sure it used same format everywhere (#1966) 2017-03-06 08:44:37 +10:00
amaitland c827af48b3 Re-add call to Cef.RemoveDisposable 2017-02-16 19:24:49 +10:00
amaitland a9c29ae279 Refactor Dispose pattern - remove new Dispose override and destructor
Design time checks are now implemented in the protected Dispose override
Rename some methods
2017-02-16 19:14:09 +10:00
Chris e844bed531 Add Minimal WinForms Designer Support (#1946)
* Fixed designer support
* Adapted to feedback
* Revert "Adapted to feedback"
This reverts commit a1541c9cee.
* Adapted to feedback
* Added missing summary
2017-02-16 19:11:33 +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 e23ad38a11 WinForms - Override IsKeyInput to get arrows + tab working when use MultiThreadedMessageLoop = false
Solution from http://stackoverflow.com/a/5606692
Post on ceforum for background info http://magpcss.org/ceforum/viewtopic.php?f=6&t=14557
2016-10-10 12:54:43 +10:00
smcilveen d1142e6374 Fixing nullreferenceexception on ControlExtensions.IsActive (#1788) 2016-08-30 23:16:02 +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
Dan Backes 7108ae3f43 Fix LifeSpanHandler not Called During Dispose (#1764)
- Make it so that the lifespan handler is still called when the
  ChromiumWebBrowser is disposed We need to make sure that the
  LifeSpanHandler is still around when `managedCefBrowserAdapter`
  is disposed since it is going to call `CloseBrowser`. That way,
  we can implement LifeSpanHandler and reject closing the entire
  application as described in #1574
2016-08-09 12:32:41 +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 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 af457916e3 Implement IFindHandler
Resolves #1459
2016-03-07 12:44:49 +10:00
amaitland 71ce888073 First steps to publishing a symbols package
Add pdb files to nuspec - they're only included when the -symbol flag is used
Add src files to nuspec - they're only included when the -symbol flag is used
Update appveyor.yml to push symbol packages to the MyGet feed
Add -symbol flag to build.ps1 so the symbol packages are generated
WinForms project not outputs pdb files
WinForms release builds are not optimized - probably should have been already
2016-02-26 11:49:52 +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
amaitland bae3c28e92 Update copyright to 2016 2016-01-11 14:11:30 +10:00
amaitland 37f584ed01 Remove NotifyMoveOrResizeStarted and SetFocus from WinForms ChromiumWebBrowser - will mark them as obsolete in the 47 branch so they can be removed from master 2016-01-09 08:09:39 +10:00
amaitland 83dba09e99 Start to remove some of the methods from ManagedCefBrowserAdapter that are now available through IBrowserHost 2016-01-09 08:09:38 +10:00
Rich McNeary 7d4e074ef4 Move OnFocusedNodeChanged into new IRenderProcessMessageHandler. 2015-12-08 09:32:54 -05:00
Atvaark b04ccbb269 Add missing comments 2015-11-04 13:10:00 +10:00
amaitland efb841fdca Add CefSharpSettings.ShutdownOnExit - all the user to disable the inbuilt call to Cef.Shutdown
(Also needs to set shutdownOnProcessExit:false when calling Cef.Initialize, or the ParentProcessExitHandler will be called to Shutdown Cef)
2015-10-08 22:37:14 +10:00
amaitland 190178e79e Only enable WCF if a bound object has been registered
Fixes #1272
2015-09-18 13:56:43 +10:00
amaitland 45e5da8d7b Remove obsolete methods 2015-09-01 22:49:17 +10:00
amaitland 29e6bc7571 Rename IMenuHandler to IContextMenuHandler 2015-08-17 13:42:44 +10:00
amaitland 41acea55d3 Add ILoadHandler to directly expose CefLoadHandler interface
Rather than have a complex set of rules where some methods were handled via IPopupHandler and others weren't
It's just a basic wrapper around CEF now with the internal event handlers only being called if it's not a popup
2015-08-17 11:54:40 +10:00
amaitland bb3103e1c2 Rename IPopupHandler to IDisplayHandler 2015-08-17 11:23:21 +10:00
amaitland 2368115c61 Make CanReload as Obsolete - use IsLoading instead 2015-08-13 21:39:19 +10:00
amaitland 77c11c3ad0 Move Title property from IWebBrowser to IWpfWebBrowser (not really required for WinForms and OffScreen)
TitleChanged EventHandler is now the best way to access these for WinForms and OffScreen
2015-08-13 21:36:18 +10:00
amaitland 74665ef4e2 Pass args directly into the IWebBrowserInternal implementation (ChromiumWebBrowser) so that extra params can be added easily
Add some more TODO's - still some API cleanup work required
2015-08-13 21:33:23 +10:00
amaitland 7092d18af1 Add controlHandle property to to IWebBrowserInternal
For WinForms only create the browser if HasParent = false
2015-08-03 17:55:41 +10:00
cefsharp-ms 0b300d5dda Merged master 2015-07-31 17:41:00 +02:00
amaitland 9a0d7688a0 Merge branch 'cef/2272' 2015-07-28 17:17:12 +10:00
amaitland ce2521c986 Add IWebBrowserInternal.HasParent property so we know when there is a parent - OnAfterCreated is handled different for popup with a parent 2015-07-28 16:59:59 +10:00
amaitland 6ccf8afbad Add BrowserAdapter to IWebBrowserInternal (was previously removed as it was no longer required) 2015-07-28 16:03:27 +10:00
cefsharp-ms a99e020138 added option to register async js objects with only method bindings 2015-07-23 15:10:28 +02:00
jankurianski 695b444ce4 OnGotFocus no longer calls SetFocus if browser not initialized.
Fixes following crash:

Exception: System.Exception
Message: 'Browser Is Not yet initialized. Use the
IsBrowserInitializedChanged event and checkthe IsBrowserInitialized
property to determine when the browser has been intialized.'
Source: CefSharp
Stacktrace:
at
CefSharp.WebBrowserExtensions.ThrowExceptionIfBrowserNotInitialized(IWebBrowser
browser)
at CefSharp.WinForms.ChromiumWebBrowser.SetFocus(Boolean isFocused)
at CefSharp.WinForms.ChromiumWebBrowser.OnGotFocus(EventArgs e)
at System.Windows.Forms.Control.WmSetFocus(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
2015-07-23 12:19:08 +10:00
amaitland 0c031a1a3b Split RequestContext out from BrowserSettings 2015-07-22 13:51:16 +10:00