aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Hiller2013-03-12 20:52:45 (EDT)
committerGrant Gayed2013-03-13 10:02:01 (EDT)
commit5fd8d67aa375be6561c551ec29265e8089731368 (patch)
treef104d889025b8a46f9135b663ccac1e1b141389a
parenta587ccebeb14f1a19c8e7d1be250201c28af863c (diff)
downloadeclipse.platform.swt-5fd8d67aa375be6561c551ec29265e8089731368.zip
eclipse.platform.swt-5fd8d67aa375be6561c551ec29265e8089731368.tar.gz
eclipse.platform.swt-5fd8d67aa375be6561c551ec29265e8089731368.tar.bz2
adding title event
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFClient.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFDisplayHandler.java16
3 files changed, 25 insertions, 3 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 12fffa8..db2e1b2 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
@@ -374,6 +374,16 @@ public void onLocationChange(String location, boolean top) {
locationListeners[i].changed (event);
}
}
+
+public void onTitleChange(String title) {
+ TitleEvent event = new TitleEvent(browser);
+ event.display = browser.getDisplay ();
+ event.widget = browser;
+ event.title = title;
+ for (int i=0; i < titleListeners.length; i++) {
+ titleListeners[i].changed (event);
+ }
+}
public void refresh() {
if (cefBrowser == null) return;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFClient.java b/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFClient.java
index 29fe908..cedadde 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFClient.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEFClient.java
@@ -117,7 +117,7 @@ long /*int*/ get_dialog_handler() {
long /*int*/ get_display_handler() {
if (Device.DEBUG) System.out.println("get_display_handler (impl)");
if (displayHandler == null) {
- displayHandler = new CEFDisplayHandler();
+ displayHandler = new CEFDisplayHandler(host);
}
displayHandler.add_ref();
return displayHandler.getAddress();
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 96271b7..ec6000c 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,12 +12,15 @@ package org.eclipse.swt.browser;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.internal.cef3.CEF3Object;
+import org.eclipse.swt.widgets.Display;
public class CEFDisplayHandler {
CEF3Object object;
+ CEF host;
int refCount = 1;
-public CEFDisplayHandler() {
+public CEFDisplayHandler(CEF host) {
+ this.host = host;
object = new CEF3Object (new int[] {0, 0, 0, 4, 3, 2, 2, 2, 4}) {
public long /*int*/ method0(long /*int*/[] args) {return add_ref();}
public long /*int*/ method1(long /*int*/[] args) {return CEFDisplayHandler.this.release();}
@@ -70,7 +73,16 @@ long /*int*/ on_address_change(long /*int*/ browser, long /*int*/ frame, long /*
}
long /*int*/ on_title_change(long /*int*/ browser, long /*int*/ title) {
- if (Device.DEBUG) System.out.println("on_title_change (TODO)");
+ if (Device.DEBUG) System.out.println("on_title_change (impl)");
+
+ final String titleString = CEF.ExtractCEFString(title);
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ host.onTitleChange(titleString);
+ }
+ });
+
return 0;
}