From e1f72c7af97d691a86c2d43e04ca6f7eab70671e Mon Sep 17 00:00:00 2001 From: Benoit Hiller Date: Tue, 12 Mar 2013 21:32:41 -0400 Subject: moving location event --- .../win32/org/eclipse/swt/browser/CEFDisplayHandler.java | 13 ++++++++++++- .../win32/org/eclipse/swt/browser/CEFLoadHandler.java | 12 +----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFDisplayHandler.java b/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFDisplayHandler.java index aaa2480faa..53e83d2b44 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFDisplayHandler.java +++ b/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFDisplayHandler.java @@ -12,6 +12,7 @@ package org.eclipse.swt.browser; import org.eclipse.swt.graphics.Device; import org.eclipse.swt.internal.cef3.CEF3Object; +import org.eclipse.swt.internal.cef3.CEFFrame; import org.eclipse.swt.widgets.Display; public class CEFDisplayHandler { @@ -68,7 +69,17 @@ long /*int*/ on_loading_state_change(long /*int*/ browser, int isLoading, int ca } long /*int*/ on_address_change(long /*int*/ browser, long /*int*/ frame, long /*int*/ url) { - if (Device.DEBUG) System.out.println("on_address_change (TODO)"); + if (Device.DEBUG) System.out.println("on_address_change (impl)"); + + CEFFrame cefFrame = new CEFFrame(frame); + final String location = CEF.getUrl(cefFrame); + final boolean top = cefFrame.is_main() == 1; + + Display.getDefault().asyncExec(new Runnable() { + public void run() { + host.onLocationChange(location, top); + } + }); return 0; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFLoadHandler.java b/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFLoadHandler.java index 4848bfc003..c7c3e6f0ba 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFLoadHandler.java +++ b/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFLoadHandler.java @@ -63,17 +63,7 @@ synchronized int release() { /* cef_load_handler_t */ long /*int*/ on_load_start(long /*int*/ browser, long /*int*/ frame) { - if (Device.DEBUG) System.out.println("on_load_start (impl)"); - - CEFFrame cefFrame = new CEFFrame(frame); - final String location = CEF.getUrl(cefFrame); - final boolean top = cefFrame.is_main() == 1; - - Display.getDefault().asyncExec(new Runnable() { - public void run() { - host.onLocationChange(location, top); - } - }); + if (Device.DEBUG) System.out.println("on_load_start (TODO)"); return 0; } -- cgit v1.2.3