diff options
Diffstat (limited to 'embed/mozilla/EphyBrowser.cpp')
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index ba295ef7c..231b5c4ac 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -536,6 +536,9 @@ nsresult EphyBrowser::Init (GtkMozEmbed *mozembed) getter_AddRefs(mWebBrowser)); NS_ENSURE_TRUE (mWebBrowser, NS_ERROR_FAILURE); + mWebBrowserFocus = do_QueryInterface (mWebBrowser); + NS_ENSURE_TRUE (mWebBrowserFocus, NS_ERROR_FAILURE); + mWebBrowser->GetContentDOMWindow (getter_AddRefs (mDOMWindow)); NS_ENSURE_TRUE (mDOMWindow, NS_ERROR_FAILURE); @@ -861,13 +864,9 @@ nsresult EphyBrowser::GetTargetDocument (nsIDOMDocument **aDOMDocument) } /* Use the focused document */ - nsCOMPtr<nsIWebBrowserFocus> webBrowserFocus; - webBrowserFocus = do_QueryInterface (mWebBrowser); - NS_ENSURE_TRUE (webBrowserFocus, NS_ERROR_FAILURE); - nsresult rv; nsCOMPtr<nsIDOMWindow> DOMWindow; - rv = webBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow)); + rv = mWebBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow)); if (NS_SUCCEEDED (rv) && DOMWindow) { return DOMWindow->GetDocument (aDOMDocument); @@ -1324,3 +1323,21 @@ EphyBrowser::GetDocumentType () return type; } + +#ifdef GTKMOZEMBED_BROKEN_FOCUS +nsresult +EphyBrowser::FocusActivate () +{ + NS_ENSURE_STATE (mWebBrowserFocus); + + return mWebBrowserFocus->Activate(); +} + +nsresult +EphyBrowser::FocusDeactivate () +{ + NS_ENSURE_STATE (mWebBrowserFocus); + + return mWebBrowserFocus->Deactivate(); +} +#endif /* GTKMOZEMBED_BROKEN_FOCUS */ |