mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-06 22:52:44 +00:00
10 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
![]() |
16e0fa30d4 |
This checkin enables the mozilla side of mouse and key listener
behavior. Next step is to enable the java side in test-first design fashion. A webclient/src_moz/EmbedEventListener.cpp A webclient/src_moz/EmbedEventListener.h - carried over directly from GtkMozEmbed, minus GTK code. M webclient/src_moz/EmbedProgress.cpp - call to NativeBrowserControl::ContentStateChange() to hook up listeners. M webclient/src_moz/Makefile.in - add new EmbedEventListener.cpp file M webclient/src_moz/NativeBrowserControl.cpp M webclient/src_moz/NativeBrowserControl.h - new methods for hooking up listeners. |
||
![]() |
8484d431af |
This checkin implements a response header listener feature.
I have changed the usage contract of the DocumentLoadListener slightly. Prior to this checkin, calling getEventData() on the DocumentLoadEvent passed in to your eventDispatched() method returned the URI to which the event applies. Now the getEventData() returns a Map. You must look up the "URI" key to find the URI to which the event applies. If your listener is an instance of PageInfoListener, and your event mask is END_URL_LOAD_EVENT_MASK, your Map will have an additional entry under the key "headers". This entry is another Map representing the response headers. DocumentLoadListener: * <p>The <code>eventDispatched()</code> method is passed a {@link * DocumentLoadEvent} instance. The <code>type</code> property of the * event will be one of the types defined as a <code>public static final * int</code> in <code>DocumentLoadEvent</code>.</p> * * <p>The <code>eventData</code> property of the * <code>DocumentLoadEvent</code> instance will be a * <code>java.util.Map</code>. For all <code>EVENT_MASK</code> types in * <code>DocumentLoadEvent</code> the map will contain an entry under * the key "<code>URI</code>" without the quotes. This will be the * fully qualified URI for the event.</p> * * <p>For the <code>PROGRESS_URL_LOAD_EVENT_MASK</code> there will be an * entry in the map for the key "<code>message</code>". This will be * the progress message from the browser.</p> PageInfoListener: * <p>This {@link DocumentLoadListener} subclass adds the ability to get * detailed information on each event. </p> * * <p>The <code>eventDispatched()</code> method is passed the same thing * as in the {@link DocumentLoadListener}.</p> * * <p>The <code>eventData</code> property of the * <code>DocumentLoadEvent</code> instance will be a * <code>java.util.Map</code>. For the * <code>END_URL_LOAD_EVENT_MASK</code> type in * <code>DocumentLoadEvent</code> the map will contain an entry under * the key "<code>URI</code>" without the quotes. This will be the * fully qualified URI for the event. The map will also contain an * entry under the key "<code>headers</code>". This entry will be a * <code>Map</code> of all the response headers.</p> The next step will be to allow the same procedure to work to discover the request headers. Ed A classes_spec/org/mozilla/webclient/PageInfoListener.java - marker class for listenening for high fidelity page information. A src_moz/EventRegistrationImpl.cpp - add boolean property, capturePageInfo to turn on or off high fidelity page information collection. M build-tests.xml - add new test, DocumentLoadListenerTest M build.xml - added new JNI class, EventRegistrationImpl M classes_spec/org/mozilla/webclient/CurrentPage2.java M classes_spec/org/mozilla/webclient/impl/wrapper_native/CurrentPageImpl.java - rollback previous API for headers discovery M classes_spec/org/mozilla/webclient/impl/wrapper_native/EventRegistrationImpl.java - pass thru the capturePageInfo property - add URIToStringMap, currently not working. M classes_spec/org/mozilla/webclient/test/EMWindow.java - call toString() on the eventData, don't cast it to a String. M src_moz/EmbedProgress.cpp M src_moz/EmbedProgress.h - leverage the nsIHttpHeaderVisitor interface to discover the response headers. - add boolean property capturePageInfo A src_moz/HttpHeaderVisitorImpl.cpp A src_moz/HttpHeaderVisitorImpl.h - copy the headers to a Properties object. M src_moz/Makefile.in - compile two new files: + EventRegistrationImpl.cpp \ + HttpHeaderVisitorImpl.cpp \ M src_moz/NativeBrowserControl.cpp M src_moz/NativeBrowserControl.h - pass the NativeWrapperFactory to our Init() method - add wrapperFactory getter. M src_moz/WrapperFactoryImpl.cpp - pass the nativeWrapperFactory to the NativeBrowserControl's Init method. M src_share/jni_util.cpp M src_share/jni_util.h - new constants: URI, headers R test/automated/src/classes/org/mozilla/webclient/CurrentPageTest.java - not yet time for this one A test/automated/src/classes/org/mozilla/webclient/DocumentLoadListenerTest.java - exercise bare minimum functionality of PageInfoListener M test/manual/src/classes/org/mozilla/webclient/test/TestBrowser.java - print out headers. |
||
![]() |
62ba5ac0a3 |
This checkin verifies that loading documents over HTTP works as
expected. M src_moz/Makefile.in - added WindowWatcher to compilation M src_moz/NativeBrowserControl.cpp - turn on our WindowWatcher. Still need to flesh this out, but it seemed to be necessary for http to work. M src_moz/WindowCreator.cpp M src_moz/WindowCreator.h - return to compilation M src_moz/WrapperFactoryImpl.cpp - hack to workaround bug posted to n.p.m.e by me today regarding nsIOService::SetOffline(TRUE) being called. The workaround is to manually call nsIOService::SetOffline(FALSE) *after* the point in time where the "TRUE" call is made. M test/automated/src/classes/org/mozilla/util/THTTPD.java - tweaks to make this suitable for JUnit testing. M test/automated/src/classes/org/mozilla/webclient/NavigationTest.java - all navigation tests work. |
||
![]() |
7573cd136f |
This checkin enables the StartDocumentLoadEvent. Now adding the rest of
the DocumentLoadListener events will be trivial. Next step: flesh out the rest of the DocumentLoadListener events. Modify NavigationTest so that it does its selection checking inside the listeners. This will probably require creating a Thread, managed by EventRegistrationImpl, that is used to process callbacks from mozilla into Java, so that we don't get deadlock. M classes_spec/org/mozilla/webclient/impl/wrapper_native/EventRegistrationImpl.java - remove all dependencies on NativeEventThread - introduce dependency on BrowserControlCanvas (needed for future MouseListener) work. - {add,remove}DocumentLoadListener() now just a matter of adding/removing to List. - add nativeEventOccurred() method, called from native code M classes_spec/org/mozilla/webclient/impl/wrapper_native/NativeEventThread.java - remove dependency on BrowserControlCanvas - removed nativeEventOccurred M src_moz/EmbedProgress.cpp - delete the global ref in the dtor. - create the global ref in SetEventRegistration(). - call back to Java on startDocumentLoad. M src_moz/NativeBrowserControl.cpp - initialize our string constants. M src_share/jni_util.cpp M src_share/jni_util.h - alter the signature of util_SendEventToJava -void util_SendEventToJava(JNIEnv *yourEnv, jobject nativeEventThread, - jobject webclientEventListener, +void util_SendEventToJava(JNIEnv *yourEnv, jobject eventRegistrationImpl, jstring eventListenerClassName, jlong eventType, jobject eventData) M test/automated/src/classes/org/mozilla/webclient/NavigationTest.java - show that the DocumentLoadListener gets called. |
||
![]() |
b1f9171e41 |
This checkin is the next step for getting DocumentLoadListener to work.
I now have the new architecture for pumping events from mozilla back into java. I've added a sequence diagram to <http://www.mozilla.org/projects/blackwood/webclient/design/20040306-webclient-2_0.zargo> and updated the private API class diagram. The next step will be to have the EmbedProgress::On* methods call back to EventRegistration.nativeEventOccured. M src_moz/EmbedProgress.cpp M src_moz/EmbedProgress.h - make this class maintain a reference to the java EventRegistration instance for this BrowserControl M src_moz/NativeBrowserControl.cpp M src_moz/NativeBrowserControl.h - make this class maintain a reference to the java BrowserControl instance. M src_moz/WindowControlImpl.cpp - push the java BrowserControl to the NativeBrowserControl on Realize(). M src_moz/WrapperFactoryImpl.cpp M src_moz/ns_globals.h - expose gImplementedInterfaces in ns_globals.h |
||
![]() |
485106034b |
This checkin is the first step to making DocumentLoadListener work
again. It provides the native class that implements nsIWebProgressListener, which I've copied form gtk_moz_embed, so it's gotta be good. The next step will be to hook this up to the java side. A src_moz/EmbedProgress.h A src_moz/EmbedProgress.cpp - mostly copied from GTKMOZEMBED M classes_spec/org/mozilla/webclient/impl/wrapper_native/NativeEventThread.java - remove javadoc reference to non-existing method M src_moz/EmbedWindow.cpp M src_moz/EmbedWindow.h - expose AddWebBrowserListener method. M src_moz/InputStreamShim.cpp - make FileInputStream testcase run M src_moz/Makefile.in M src_moz/NativeBrowserControl.cpp M src_moz/NativeBrowserControl.h - add EmbedProgress M test/automated/src/classes/org/mozilla/webclient/NavigationTest.java - Make this test run |
||
![]() |
273dee2dd2 |
M build-tests.xml
- make NavigationTest not run M build.xml - Move Win32BrowserControlCanvas up to parent package M classes_spec/org/mozilla/webclient/BrowserControlCanvas.java - You can't resize until you're initialized - pass visibility through to native layer M classes_spec/org/mozilla/webclient/impl/BrowserControlImpl.java - Use WrapperFactory to create the BrowserControlCanvas impl. A classes_spec/org/mozilla/webclient/impl/wrapper_native/Win32BrowserControlCanvas.java - moved up from child package M classes_spec/org/mozilla/webclient/impl/wrapper_native/WindowControlImpl.java - use the new thread model for nativeSetBounds(), nativeRealize(), nativeSetVisible(). M classes_spec/org/mozilla/webclient/impl/wrapper_native/WrapperFactoryImpl.java - make this create the BrowserControlCanvas instance. - honor the new package name for Win32BrowserControlCanvas. R classes_spec/org/mozilla/webclient/impl/wrapper_native/win32/Win32BrowserControlCanvas.java - moved up one level. M src_moz/EmbedWindow.cpp M src_moz/EmbedWindow.h - Take size parameters to CreateWindow_ M src_moz/Makefile.in - add WindowControlImpl.cpp M src_moz/NativeBrowserControl.cpp M src_moz/NativeBrowserControl.h - add size parameters to Realize(). M src_moz/WindowControlImpl.cpp - reactivate nativeRealize(), nativeSetVisible(), nativesetBounds(), M src_moz/win32/Win32BrowserControlCanvas.cpp - new package name M test/automated/src/classes/org/mozilla/webclient/NavigationTest.java - we have to create a Canvas to load a URL. Mozilla limitation. M test/automated/src/classes/org/mozilla/webclient/impl/wrapper_native/WrapperFactoryImplTest.java - remove unneeded test metdod |
||
![]() |
c2d7e96b90 |
The churn continues. After this checkin, BrowserControlFactoryTest
runs, but nothing else does. As you all probably already know, all mozilla API calls have to happen on the same thread. For webclient, this will be the NativeEventThread. This change-bundle does many many things, here are the main ones. These changes are in concert with the checkin I just did to the diagram at <http://www.mozilla.org/projects/blackwood/webclient/design/20040306-webclient-2_0.zargo>. M classes_spec/org/mozilla/webclient/impl/WrapperFactory.java M classes_spec/org/mozilla/webclient/impl/wrapper_native/WrapperFactoryImpl.java * <p>This class is the hub of the startup and shutdown sequence for * Webclient. It is a singleton and owns references to other app * singletons:</p> * * <ul> * <li><p>{@link NativeEventThread}</p></li> * * <li><p>{@link Bookmarks}</p></li> * * <li><p>{@link Preferences}</p></li> * * <li><p>{@link ProfileManager}</p></li> * <li><p>the native object singleton corresponding to this java * object (if necessary)</p></li> * * </ul> * * <p>It maintains a set of {@link BrowserControlImpl} instances so that * we may return the native pointer for each one.</p> * * <p>This class is responsible for creating and initializing and * deleting {@link BrowserControlImpl} instances, as well as ensuring * that the native counterpart is proprely maintained in kind.</p> * * <p>This class has a tight contract with {@link * NativeEventThread}.</p> - make BrowserControl creation and deletion part of this classes responsibilities. - introduce NativeWrapperFactory concept. - own the one and only NativeEventThread. M classes_spec/org/mozilla/webclient/impl/wrapper_native/NativeEventThread.java - make this a singleton. - remove dependencies on BrowserControl and nativeBrowserControl * <p>This is a singleton class. All native events pass thru this class * by virtue of the {@link #pushRunnable} or {@link pushNotifyRunnable} * methods.</p> - remove listener logic. This'll go into EventRegistration, where it belongs. A src_moz/NativeWrapperFactory.cpp A src_moz/NativeWrapperFactory.h - takes the place of the old WebclientContext - is now a class M classes_spec/org/mozilla/webclient/impl/BrowserControlImpl.java - this no longer destroys the nativeBrowserControl. That is now done by WrapperFactoryImpl. M classes_spec/org/mozilla/webclient/impl/WebclientFactoryImpl.java - no longer maintain browserControlCount. M classes_spec/org/mozilla/webclient/impl/wrapper_native/BookmarksImpl.java M classes_spec/org/mozilla/webclient/impl/wrapper_native/NavigationImpl.java M classes_spec/org/mozilla/webclient/impl/wrapper_native/PreferencesImpl.java M classes_spec/org/mozilla/webclient/impl/wrapper_native/ProfileManagerImpl.java - rename NativeContext to NativeWrapperFactory, to illustrate its singletonness. M classes_spec/org/mozilla/webclient/impl/wrapper_native/EventRegistrationImpl.java - comment out a bunch of stuff in anticipation of the new threading model, currently being fleshed out. M classes_spec/org/mozilla/webclient/impl/wrapper_native/ImplObjectNative.java - NativeEventThread is singleton M src_moz/BookmarksImpl.cpp M src_moz/PreferencesImpl.cpp M src_moz/ProfileManagerImpl.cpp M src_moz/RDFEnumeration.cpp M src_moz/RDFTreeNode.cpp - rename WebclientContext to NativeWrapperFactory. M src_moz/EmbedWindow.cpp - mBaseWindow->Destroy(); + if (mBaseWindow) { + mBaseWindow->Destroy(); + } M src_moz/Makefile.in - Bring back NavigationImpl - add NativeWrapperFactory. M src_moz/NativeBrowserControl.cpp M src_moz/NativeBrowserControl.h - move event queue and java related stuff to NativeWrapperFactory. This class is now essentially a copy of EmbedPrivate in GtkEmbed. M src_moz/NativeEventThread.cpp - remove methods, most of it has moved to WrapperFactoryImpl/NativeWrapperFactory. M src_moz/NavigationImpl.cpp - comment out all methods but LoadURI. M src_moz/WrapperFactoryImpl.cpp - take functionality over from NativeEventThread. M src_moz/ns_util.cpp M src_moz/ns_util.h - the eventQueue is owned by NativeWrapperFactory now. M src_moz/rdf_util.cpp M src_share/jni_util.cpp - make all exceptions RuntimeExceptions, so they can be thrown from a Runnable. M test/automated/src/classes/org/mozilla/webclient/impl/wrapper_native/WrapperFactoryImplTest.java - comment out the meat of this test until I figure out how to test it. M test/automated/src/test/BrowserControlFactoryTest_correct - new content. |
||
![]() |
be6e7e4214 |
A src_moz/EmbedWindow.h
A src_moz/EmbedWindow.cpp - copied from GtkEmbed, but modified for our purposes. M src_moz/Makefile.in - compile EmbedWindow M src_moz/NativeBrowserControl.cpp M src_moz/NativeBrowserControl.h - hook EmbedWindow to our object hierarchy |
||
![]() |
0995c89706 |
- rename initContext to NativeBrowserControl, at both the native and
java layers. - Rework NativeEventThread to be usable without having the browserControl window realized. - change who owns the NativEventThread to be the BrowserControl, by proxy through WrapperFactoryImpl. Again, this is with a view toward using webclient without the browserControl window realized. A webclient/src_moz/NativeBrowserControl.h A webclient/src_moz/NativeBrowserControl.cpp - Centerpiece of native Object hierarchy. Owned by NativeEventThread. M webclient/build-tests.xml - reformat - add new test, currently failing, for Navigation. M webclient/classes_spec/org/mozilla/webclient/impl/BrowserControlImpl.java - destroy our nativeBrowserControl. M webclient/classes_spec/org/mozilla/webclient/impl/WrapperFactory.java - Added API for obtaining the NativeEventThread for a BrowserControl. M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/BookmarksImpl.java M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/CurrentPageImpl.java M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/EventRegistrationImpl.java M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/HistoryImpl.java M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/NavigationImpl.java - rename nativeWebShell to nativeBrowserControl M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/ImplObjectNative.java - rename nativeWebShell to nativeBrowserControl - add method to get the NativeEventThread for this instance. M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/NativeEventThread.java - remove dependency on WindowControl - make this class be the owner of the nativeBrowserControl instance. - rename nativeWebShell to nativeBrowserControl - renamed nativeInitialize to nativeStartup - added nativeShutdown M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/WindowControlImpl.java - remove delete() method. - no longer owns NativeEventThread - no longer owns nativeBrowserControl M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/WrapperFactoryImpl.java - Take over NativeEventThread ownership responsibilities from WindowControlImpl (by proxy for BrowserControl). M webclient/src_moz/CBrowserContainer.cpp M webclient/src_moz/CBrowserContainer.h M webclient/src_moz/CurrentPageActionEvents.cpp M webclient/src_moz/CurrentPageActionEvents.h M webclient/src_moz/CurrentPageImpl.cpp M webclient/src_moz/HistoryActionEvents.cpp M webclient/src_moz/HistoryActionEvents.h M webclient/src_moz/HistoryImpl.cpp M webclient/src_moz/NativeEventThreadActionEvents.cpp M webclient/src_moz/NativeEventThreadActionEvents.h M webclient/src_moz/NavigationActionEvents.cpp M webclient/src_moz/NavigationActionEvents.h M webclient/src_moz/NavigationImpl.cpp M webclient/src_moz/PromptActionEvents.cpp M webclient/src_moz/PromptActionEvents.h M webclient/src_moz/WindowControlActionEvents.cpp M webclient/src_moz/WindowControlActionEvents.h M webclient/src_moz/WindowCreator.cpp M webclient/src_moz/WindowCreator.h - rename nativeWebShell to nativeBrowserControl M webclient/src_moz/Makefile.in - comment out not yet fixed per-window sources - add NativeBrowserControl.cpp M webclient/src_moz/NativeEventThread.cpp - major refactoring. Much of the work is now being done in NativeBrowserControl.cpp M webclient/src_moz/WindowControlImpl.cpp - remove functionality now located in NativeEventThread and NativeBrowserControl. M webclient/src_moz/WrapperFactoryImpl.cpp - flesh out native{Create,Destroy}BrowserControl. M webclient/src_moz/ns_globals.h - remove gActionQueue and gEmbeddedThread. Moved into class NativeBrowserControl. M webclient/src_moz/ns_util.cpp - rename initContext to NativeBrowserControl - get action queue from NativeBrowserControl M webclient/src_moz/ns_util.h - remove WebShellInitContext! It's finally a class now, called NativeBrowserControl. M webclient/test/automated/src/classes/org/mozilla/webclient/impl/wrapper_native/WrapperFactoryImplTest.java - added new testcase to show create/deleteBrowserControl works. |