Commit Graph

93 Commits

Author SHA1 Message Date
Alex Maitland 45e134227e WinForms - Add LifeSpanHandler implementation capable of hosting popups as Tabs/Controls (#3529)
* WinForms - Add LifeSpanHandler implementation capable of hosting popups  as Tabs/Child controls in WinForms

- Update Example
- Remove PopupAsChildHelper and example LifeSpanHandler
- Examples always opens popups as tabs now.
- Improve xml doc and comments
- Make ParentFormMessageInterceptor public
- Make ChromiumHostControl public, move into CefSharp.WinForms.Host namespace
  Rather than having the class in the CefSharp.WinForms namespace and potentially
  confuse users, move into it's own namespace.
- Clarify ShowDevToolsDocked needs to be used with the new WinForms lifespan handler
2021-06-04 14:59:28 +10:00
Alex Maitland e4c585609e WinForms - Add ChromiumRenderWidgetHandleFinder/ChromiumWidgetNativeWindow
Used to hook the low level HWND and get message (e.g. mouse messages)

Updated the example
2021-05-11 20:39:14 +10:00
amaitland e8cf336bf3 Net Core - Support for compiling with .Net Core 3.1
- Make Wpf/WinForms/OffScreen projects target AnyCPU
Only the VC++ projects are platform specific now.
- Remove BrowserSubProcess project reference
Not needed as we now have a standalone exe
- Add OffScreen example
- Add WPF Example project
- Fix some compile errors for main solution
- Add BrowserSubProcess executable
- JavascriptObjectRepository remove isAsync param
Rather than throw exception remove the option
- BrowserSubprocess Exclude the WCF specific code from the netCore project
- Add some ifdef/ifndef to exclude the WCF specific implementation
- Move WCF implementation into separate namespace
2020-07-23 15:23:45 +10:00
Konstantin Preißer 5e89f71a44 Add new projects targeting .NET Core 3.1 (#3181)
* Add .NET Core 3.1 projects for CefSharp, CefSharp.Core, CefSharp.BrowserSubprocess.Core, CefSharp.WinForms, CefSharp.Wpf, CefSharp.OffScreen.

Contributes to CefSharp#2796

* - Remove dependencies to "opengl32.lib" and "glu32.lib" which aren't available for ARM64 and don't seem to be needed.
- Clean up project files.

* Switch project CefSharp.netcore.csproj to AnyCPU as it doesn't require different builds for each platform.

* Remove WindowsTargetPlatformVersion property as that is declared in CefSharp.props.

* Use "bin.netcore" and "obj.netcore" as [intermediate] output path for the .NET Core projects, to allow side-by-side builds with the .NET Framework projects.

* Output documentation files.

* Add CefSharp.Example.netcore and CefSharp.WinForms.Example.netcore.

* Follow-up: Remove properties from the example projects that are also not used in the corresponding .NET Framework projects.
2020-07-23 15:21:14 +10:00
Alex Maitland 8d25b71490 Core - Re-Add IAudioHandler (#3153)
Resolves #3152
2020-07-08 08:06:16 +10:00
campersau 3b89e27884 WinForms Example - Use Uri.EscapeDataString instead of WebUtility.HtmlEncode for escaping query string value (#3162) 2020-06-30 20:57:24 +10:00
amaitland 253849549b WinForms Example - Use google.com as search engine when invalid url entered in address
If Uri.IsWellFormedUriString is false then we'll load using https://www.google.com/search?q=
2020-06-30 14:28:13 +10:00
amaitland ca2837f928 WinForms - Make ControlExtensions.InvokeOnUiThreadIfRequired internal
- Additional check is control is being Disposed
- Add copy and paste version of ControlExtensions.InvokeOnUiThreadIfRequired to example project

Resolves #2983
2019-12-02 20:37:41 +10:00
amaitland 1d2fb9531f WinForms Example - Add ChromiumContainerControl to host docked DevTools
Required for arrow/tab key presses to be forwarded correctly to DevTools
Only required when CefSettings.MultiThreadedMessageLoop = false
2019-09-10 19:41:21 +10:00
amaitland 7980c30478 WinForms Example - Minor changes to DevTools docked example
- Add/revise comments
- Rename some variables

Follow up to #2804
2019-08-14 11:11:10 +10:00
Luke 1992e4970c WinForms - Add example of how to dock devtools into the same window. (#2804)
* Add a SplitContainer as the base UI panel and place the browserPanel in Panel1 and new devToolsPanel in Panel2.
Create two new public methods to open and close the devtools.

* BrowserForm - Changed the Show/Close devtools to call the new methods in the BrowserTabUserControl. If the LifeHandler is null, normal behaviour is assumed.

* Handle the DoClose event in LifeSpanHandler if the IBrowserHost.CloseDevTools() is called directly. This is more of a fail-safe, if the normal CEF behaviour is allowed then entire application will close.

* Added some addtional comments.

* Uncomment the instantiation of the LifeSpanHandler

* Removed devToolsPanel from designer
Removed CloseDevToolsDocked() method
Made ShowDevToolsDocked() method easier to copy and paste
Closing Devtools should now be handled in LifeSpanHandler.DoClose()
Added a bool to the LifeSpanHandler constructor whether to handle Browser popups.
Added Toolscript menu item to show DevTools Docked or Popup
Added async Method to check it DevTools is open

* Changed field access modifier to private

* Renamed dispose devtools handler with a more meaningful name
2019-08-14 10:16:21 +10:00
amaitland 4183b464d1 WPF/WinForms Example - Allow mailto to trigger OnProtocolExecution
- When Url starts with mailto then use our ExampleResourceRequestHandler
- Ignore unknown scheme errors when it's mailto, we expect that it's unknown
- WPF Example remove duplicate OnLoadError in BrowserTabViewModel
2019-07-10 20:47:55 +10:00
amaitland c7b9d07008 BrowserTabUserControl - Mark DllImport as private 2019-04-16 15:16:58 +10:00
Chris e22d1c2fd2 Removed IsBrowserInitializedChangedEventArgs (#2710) 2019-04-10 19:51:34 +10:00
Alex Maitland 574bc16db2 BrowserTabUserControl - Add xml doc to SetupMessageInterceptor 2019-02-28 15:16:08 +10:00
merceyz 3eee0d6787 WinForms.Example - Fixed message interceptor not working after a render process switch 2019-02-17 20:24:27 +01:00
amaitland 4f71295941 CefSharp.Example - Move example classes into handlers/javascriptbinding folders/namespaces
Basic code cleanup
2018-10-29 16:21:42 +10:00
Chris 30ee538ce0 Added EditorConfig (#2514) 2018-09-17 00:46:21 +02: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 1107a1a894 WinForms Example - Set FocusHandler to null when multiThreadedMessageLoopEnabled = false
It's not required when multiThreadedMessageLoopEnabled = false and can interfere with
the system onscreen keyboard used by touch screen.
2018-07-23 21:18:44 +10:00
amaitland c37dbcd06a Remove Geolocation API and Upgrade version numbers to 65 2018-03-17 21:31:25 +10:00
amaitland fbce2d61de WinForms Example - Update LifeSpanHandler example to host popup in Tab (notify popup of move and resize) 2018-01-30 15:01:38 +10:00
amaitland 3334d71fc4 WinForms Example - Add binder to registered objects
Required to run BindingTest.html
2018-01-24 10:03:26 +10:00
amaitland 44b7600600 WinForms Example - Add additional JS binding 2018-01-23 21:35:23 +10:00
amaitland 679cdb5b11 JSB ResolveObject WcfEnabled = false throw exception if attempt to register sync object
Update the examples to use newer Register method as Legacy options is disabled by default
2018-01-22 11:02:23 +10:00
amaitland 6a437710b6 WinForms example use args.IsLoading rather than !args.CanReload 2017-03-06 08:55:07 +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 81366fc11f Only set keyboard handler in Winforms example of using multiThreadedMessageLoopEnabled 2016-10-04 13:55:05 +10:00
amaitland 3f70d10538 Only hook into the Chromium message loop if we're using multiThreadedMessageLoop - no need if they're running in the same thread 2016-09-08 08:53:28 +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 04885eb6d5 Add webkit.webprefs.minimum_font_size example, see that preferences are being set correctly 2016-06-13 19:07:26 +10:00
amaitland 509ab98b05 Add example of disable spell checking through preferences 2016-04-20 07:45:54 +10:00
amaitland 4c4eb210f4 Add WPF Draggable Regions Test
Remove old generic DragHandler - maybe someone will write a WinForms specific one?
Remove some unused references from CefSharp.csproj
2016-04-12 16:57:47 +10:00
amaitland 38254a59d5 Rewrite ChromeWidgetHandleFinder to use a GCHandle - much cleaner method of interfacing with dllimport 2016-04-11 07:52:10 +10:00
amaitland 7f1f1c5f21 Add example IDisplayHandler.OnFullscreenModeChange to WinForms example - reparent ChromiumWebBrowser control to demo switching to fullscreen, little bit of screen resize which isn't perfect, it works ok though. 2016-03-30 10:58:05 +10:00
amaitland dd7ea823a3 Add PopupFeatures and BrowserSettings to OnBeforePopup
Update WinForms popup example - comment out experimental feature

Had to add interfaces to allow for wrapping of the structures (BrowserSettings and PopupFeatures)

Resolves #1586
2016-03-07 18:58:56 +10:00
amaitland c4f6a4538e Running without multithreadedmessageloop would have shown the messagebox when mouse down 2016-03-02 08:32:55 +10:00
amaitland 919c43df19 Demo forwarding left mouse button down - show message box on click, currently commented out 2016-03-02 07:50:54 +10:00
amaitland 8de2257e27 Remove some unused code from the WinForms example 2016-02-25 08:23:10 +10:00
amaitland 8a93ba6564 Demo setting and then getting a reference - using enable_do_not_track an example 2016-02-02 07:35:38 +10:00
amaitland 072ca4cc97 Add IResourceHandlerFactory and IResourceHandler example - downloads a specific swf file using the .Net WebRequest class and returns the response 2016-01-18 18:32:44 +10:00
amaitland bae3c28e92 Update copyright to 2016 2016-01-11 14:11:30 +10:00
amaitland af05e56c12 Reformat inline js (use @ notation so much of the string encapsulation can be removed)
Make ScriptedMethods class static and convert the methods into extension methods (really just for the hell of it)
Make some of the comments a little less verbose in terms of number of lines
Some Resharper inspired simplifications
Other code reformatting to make consistent with other parts of the project (switch case statements should have braces, ContinueWith blocks reformatted to match others)
Untabify ScriptedMethodsTest.html
Remove unused usings from ScriptedMethods
Add a few comments about camelCaseJavascriptNames
2015-12-30 09:57:34 +10:00
Rich McNeary f1197acc78 Add menu to demonstrate javascript evaluation / execution. 2015-12-28 14:29:25 -05:00
amaitland d33c41ec5d Remove unused include
No need to wrap bool in gcroot
Move command line parsing into c# land - can be reused in a few places.
Reduce code duplication in OnProcessMessageReceived - kOnFocusedNodeChanged handler
Minor changes for code consistency/formatting
2015-12-09 11:23:06 +10:00
Rich McNeary 7d4e074ef4 Move OnFocusedNodeChanged into new IRenderProcessMessageHandler. 2015-12-08 09:32:54 -05:00
amaitland 190178e79e Only enable WCF if a bound object has been registered
Fixes #1272
2015-09-18 13:56:43 +10:00
amaitland fff0808693 Demo opening OnOpenUrlFromTab - rough example 2015-09-18 13:22:11 +10:00
amaitland 326aaf70f8 Move handlers to their own namespace and create an implementation of LifeSpanHandler to deal with custom popups 2015-08-03 17:57:01 +10:00
cefsharp-ms f74b245e9b added examples for async bindings 2015-07-31 17:17:48 +02:00