jramosd / javachromiumembedded

Automatically exported from code.google.com/p/javachromiumembedded
0 stars 0 forks source link

Extending CefBrowser by additional methods. #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This issue is an enhancement of JCEF (patch 7 of 10) 
----------------------------------------------------
Purpose: Extending CefBrowser by additional methods.

This patch relies on the attached patch file of issue #50. 
If you want to try these code changes, add the patch of issue #50 first and 
afterwards add the patch file attached to this issue. Otherwise you'll get some 
patch-errors.

With this patch, the CefBrowser is extended by the
additional methods 
- canGoBack()
- canGoForward()
- isLoading()
- reload()
- reloadIgnoreCache()
- stopLoad()
- isPopup()
- hasDocument()
- loadString()
- executeJavaScript()
- getURL()
- getZoomLevel()
- setZoomLevel()
- startDownload()
- showDevTools()
- closeDevTools()

Known issue: showDevTools() and closeDevTools() doesn't work properly.

Please see attached patch file for further informations.

Original issue reported on code.google.com by k...@censhare.de on 8 Mar 2014 at 7:59

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 12 Mar 2014 at 9:50

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 12 Mar 2014 at 9:52

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 12 Mar 2014 at 9:52

GoogleCodeExporter commented 9 years ago
Added in revision 38. Leaving this open to address the DevTools issue.

Original comment by magreenb...@gmail.com on 28 Mar 2014 at 12:38

GoogleCodeExporter commented 9 years ago
@comment #4:

Attached you'll find a patch file which fixes the DevTools issue.
Please note: The patch file depends on that ones which are attached to comment 
#6 of issue 47 
(https://code.google.com/p/javachromiumembedded/issues/detail?id=47#c6). So if 
you want to test the patch file, please add the patches from issue 47 first.

What I've done:
-------------
(*) Replaced the methods "CefBrowser.showDevTools(CefclientHandler)" and 
"CefBrowser.closeDevTools()" by "CefBrowser.getDevTools()".
    The new method getDevTools() returns a new CefBrowser object which can be embedded into your applications UI.
(*) The classes CefBrowserWr and CefBrowserOsr decide if they have to create a 
"normal" CefBrowser instance or if they have to call showDevTools() within the 
native code. 
(*) Sending close() to the DevTools CefBrowser instance, will perform a 
closeDevTools() on the native side 

This fix works for Windows and Macintosh as well. Linux is not tested but 
should work too.

One comment for Mac users:
If you're running the MainFrame test out of your IDE like Eclipse you've to add 
the CEF program argument "--resources-dir-path=/path/to/your/Chromium Embedded 
Framework.framework/Resources".
If you're using the App-Bundles, the Dev tools work without setting the 
resources path.

Original comment by k...@censhare.de on 4 Jun 2014 at 12:02

Attachments:

GoogleCodeExporter commented 9 years ago
@#5: Thanks, added in revision 78.

Original comment by magreenb...@gmail.com on 17 Jun 2014 at 4:50