diff options
author | Jean-François Rameau <jframeau@cvs.gnome.org> | 2006-10-23 01:08:06 +0800 |
---|---|---|
committer | Jean-François Rameau <jframeau@src.gnome.org> | 2006-10-23 01:08:06 +0800 |
commit | f2d423a34e23b3d785fab96c9c14925bdbe16591 (patch) | |
tree | 9bea04c2dc966a64887bd56796bc08c6051038f1 /embed/mozilla/EphyBrowser.cpp | |
parent | 461daa07586775c39d72c22287e0ab1fd1f9cf34 (diff) | |
download | gsoc2013-epiphany-f2d423a34e23b3d785fab96c9c14925bdbe16591.tar gsoc2013-epiphany-f2d423a34e23b3d785fab96c9c14925bdbe16591.tar.gz gsoc2013-epiphany-f2d423a34e23b3d785fab96c9c14925bdbe16591.tar.bz2 gsoc2013-epiphany-f2d423a34e23b3d785fab96c9c14925bdbe16591.tar.lz gsoc2013-epiphany-f2d423a34e23b3d785fab96c9c14925bdbe16591.tar.xz gsoc2013-epiphany-f2d423a34e23b3d785fab96c9c14925bdbe16591.tar.zst gsoc2013-epiphany-f2d423a34e23b3d785fab96c9c14925bdbe16591.zip |
Get keyword search back by passing ALLOW_THIRD_PARTY_FIXUP flag to gecko.
2006-10-22 Jean-François Rameau <jframeau@cvs.gnome.org>
* embed/ephy-embed.h:
* embed/ephy-embed.c:
* embed/mozilla/EphyBrowser.cpp:
* embed/mozilla/EphyBrowser.h:
* embed/mozilla/mozilla-embed.cpp:
* src/ephy-link.h:
* src/ephy-location-action.c: (action_activated_cb):
* src/ephy-shell.c: (ephy_shell_new_tab_full):
* src/ephy-shell.h:
* src/ephy-window.c: (ephy_window_open_link):
Get keyword search back by passing ALLOW_THIRD_PARTY_FIXUP flag to gecko.
Add a new load method to EphyEmbed to custom load behaviour and pass (optional) referrer.
Fix bug #350053.
Diffstat (limited to 'embed/mozilla/EphyBrowser.cpp')
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index 8e2e946a0..aba1645eb 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -1524,3 +1524,55 @@ EphyBrowser::Close () return domWin->Close(); } + +nsresult +EphyBrowser::GetPIDOMWindow(nsPIDOMWindow **aPIWin) +{ + *aPIWin = nsnull; + + // get the private DOM window + nsCOMPtr<nsPIDOMWindow> domWindowPrivate = do_QueryInterface(mDOMWindow); + + // and the root window for that DOM window + *aPIWin = domWindowPrivate->GetPrivateRoot(); + + if (*aPIWin) + { + NS_ADDREF(*aPIWin); + return NS_OK; + } + + return NS_ERROR_FAILURE; + +} + +nsresult +EphyBrowser::LoadURI(const char *aURI, + PRUint32 aLoadFlags, + nsIURI *aReferrer) +{ + nsString uURI; + nsresult rv = NS_OK; + + NS_CStringToUTF16 (nsCString (aURI), NS_CSTRING_ENCODING_UTF8, uURI); + + if (uURI.Length() == 0) return NS_OK; + + nsCOMPtr<nsIWebNavigation> contentNav = do_QueryInterface (mWebBrowser); + NS_ENSURE_TRUE (contentNav, NS_ERROR_FAILURE); + + nsCOMPtr<nsPIDOMWindow> piWin; + rv = GetPIDOMWindow(getter_AddRefs(piWin)); + NS_ENSURE_SUCCESS (rv, rv); + + nsAutoPopupStatePusher popupStatePusher(piWin, openAllowed); + + rv = contentNav->LoadURI(uURI.get(), // URI string + aLoadFlags, // Load flags + aReferrer, // Referring URI + nsnull, // Post data + nsnull); // extra headers + + return rv; +} + |