aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Hiller2013-03-12 20:54:07 (EDT)
committerGrant Gayed2013-03-13 10:02:42 (EDT)
commitc672366cb85f32ea5407233786c54d0e40be1aac (patch)
tree6087517b3c07bbaa3f87779a54b3d3a69e2540dd
parent6cd79c2e1a97d680bd49e305df0526331b321ef8 (diff)
downloadeclipse.platform.swt-c672366cb85f32ea5407233786c54d0e40be1aac.zip
eclipse.platform.swt-c672366cb85f32ea5407233786c54d0e40be1aac.tar.gz
eclipse.platform.swt-c672366cb85f32ea5407233786c54d0e40be1aac.tar.bz2
adding completion event
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFLoadHandler.java11
2 files changed, 22 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java b/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java
index 1cebc40..c7484e1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java
@@ -36,6 +36,7 @@ public class CEF extends WebBrowser {
static final String ABOUT_BLANK = "about:blank"; //$NON-NLS-1$
static final String CEF3_PATH = "org.eclipse.swt.browser.CEF3Path"; //$NON-NLS-1$
static final String URI_FILEROOT = "file:///"; //$NON-NLS-1$
+ static final int MAX_PROGRESS = 100;
static {
/*
@@ -357,13 +358,23 @@ void onDispose(Event e) {
cefBrowser = null;
// TODO more clean up
}
-
void onResize() {
Rectangle bounds = browser.getClientArea();
OS.SetWindowPos(windowHandle, 0, bounds.x, bounds.y, bounds.width, bounds.height, OS.SWP_NOZORDER | OS.SWP_DRAWFRAME | OS.SWP_NOACTIVATE | OS.SWP_ASYNCWINDOWPOS);
}
+public void onLoadComplete() {
+ ProgressEvent progress = new ProgressEvent (browser);
+ progress.display = browser.getDisplay ();
+ progress.widget = browser;
+ progress.current = MAX_PROGRESS;
+ progress.total = MAX_PROGRESS;
+ for (int i = 0; i < progressListeners.length; i++) {
+ progressListeners[i].completed (progress);
+ }
+}
+
public void onLocationChange(String location, boolean top) {
LocationEvent event = new LocationEvent(browser);
event.display = browser.getDisplay ();
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 aa01a18..4848bfc 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
@@ -78,7 +78,16 @@ long /*int*/ on_load_start(long /*int*/ browser, long /*int*/ frame) {
}
long /*int*/ on_load_end(long /*int*/ browser, long /*int*/ frame, int httpStatusCode) {
- if (Device.DEBUG) System.out.println("on_load_end (TODO)");
+ if (Device.DEBUG) System.out.println("on_load_end (impl)");
+
+ CEFFrame cefFrame = new CEFFrame(frame);
+ if (cefFrame.is_main() == 1) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ host.onLoadComplete();
+ }
+ });
+ }
return 0;
}