Bug 1377580 - Fix target=_blank somewhat for GeckoView r=esawin
Things are not perfect here, but at least they load (in the same frame)
MozReview-Commit-ID: 6Zpp1tPHFpg
--- a/mobile/android/modules/geckoview/GeckoViewNavigation.jsm
+++ b/mobile/android/modules/geckoview/GeckoViewNavigation.jsm
@@ -13,17 +13,17 @@ Cu.import("resource://gre/modules/XPCOMU
XPCOMUtils.defineLazyModuleGetter(this, "EventDispatcher",
"resource://gre/modules/Messaging.jsm");
var dump = Cu.import("resource://gre/modules/AndroidLog.jsm", {})
.AndroidLog.d.bind(null, "ViewNavigation");
function debug(aMsg) {
- // dump(aMsg);
+ // dump(aMsg + '\n');
}
// Handles navigation requests between Gecko and a GeckoView.
// Implements GeckoView.loadUri via openURI.
// Handles GeckoView:GoBack and :GoForward requests dispatched by
// GeckoView.goBack and .goForward.
// Dispatches GeckoView:LocationChange to the GeckoView on location change when
// active.
@@ -79,19 +79,30 @@ class GeckoViewNavigation extends GeckoV
// Message manager event handler.
receiveMessage(aMsg) {
debug("receiveMessage " + aMsg.name);
}
// nsIBrowserDOMWindow::openURI implementation.
openURI(aUri, aOpener, aWhere, aFlags) {
- debug("openURI: aUri.spec=" + aUri.spec);
- // nsIWebNavigation::loadURI(URI, loadFlags, referrer, postData, headers).
- this.browser.loadURI(aUri.spec, null, null, null);
+ debug('openURI: ' + aUri);
+ return this.browser.contentWindow;
+ }
+
+ // nsIBrowserDOMWindow::openURIInFrame
+ openURIInFrame(aUri, aParams, aWhere, aFlags,
+ aNextTabParentId, aName) {
+ debug('openURIInFrame: ' + aUri);
+ return this.browser.QueryInterface(Ci.nsIFrameLoaderOwner);
+ }
+
+ // nsIBrowserDOMWindow::isTabContentWindow
+ isTabContentWindow(aWindow) {
+ return this.browser.contentWindow === aWindow;
}
// nsIBrowserDOMWindow::canClose implementation.
canClose() {
debug("canClose");
return false;
}