michael@0: /* ***** BEGIN LICENSE BLOCK ***** michael@0: * Version: Mozilla-sample-code 1.0 michael@0: * michael@0: * Copyright (c) 2002 Netscape Communications Corporation and michael@0: * other contributors michael@0: * michael@0: * Permission is hereby granted, free of charge, to any person obtaining a michael@0: * copy of this Mozilla sample software and associated documentation files michael@0: * (the "Software"), to deal in the Software without restriction, including michael@0: * without limitation the rights to use, copy, modify, merge, publish, michael@0: * distribute, sublicense, and/or sell copies of the Software, and to permit michael@0: * persons to whom the Software is furnished to do so, subject to the michael@0: * following conditions: michael@0: * michael@0: * The above copyright notice and this permission notice shall be included michael@0: * in all copies or substantial portions of the Software. michael@0: * michael@0: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS michael@0: * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, michael@0: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL michael@0: * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER michael@0: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING michael@0: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER michael@0: * DEALINGS IN THE SOFTWARE. michael@0: * michael@0: * Contributor(s): michael@0: * michael@0: * ***** END LICENSE BLOCK ***** */ michael@0: michael@0: // Local includes michael@0: #include "resource.h" michael@0: #include "winEmbed.h" michael@0: #include "WebBrowserChrome.h" michael@0: michael@0: // OS headers michael@0: #include michael@0: michael@0: // Frozen APIs michael@0: michael@0: #include "nsStringAPI.h" michael@0: #include "nsIComponentManager.h" michael@0: #include "nsIDOMWindow.h" michael@0: #include "nsIInterfaceRequestor.h" michael@0: #include "nsIRequest.h" michael@0: #include "nsIURI.h" michael@0: #include "nsIWebProgress.h" michael@0: #include "nsCWebBrowser.h" michael@0: michael@0: // Glue APIs (not frozen, but safe to use because they are statically linked) michael@0: #include "nsComponentManagerUtils.h" michael@0: michael@0: // NON-FROZEN APIS! michael@0: #include "nsIWebNavigation.h" michael@0: michael@0: WebBrowserChrome::WebBrowserChrome() michael@0: { michael@0: mNativeWindow = nullptr; michael@0: mSizeSet = false; michael@0: } michael@0: michael@0: WebBrowserChrome::~WebBrowserChrome() michael@0: { michael@0: WebBrowserChromeUI::Destroyed(this); michael@0: } michael@0: michael@0: nsresult WebBrowserChrome::CreateBrowser(int32_t aX, int32_t aY, michael@0: int32_t aCX, int32_t aCY, michael@0: nsIWebBrowser **aBrowser) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aBrowser); michael@0: *aBrowser = nullptr; michael@0: michael@0: mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID); michael@0: michael@0: if (!mWebBrowser) michael@0: return NS_ERROR_FAILURE; michael@0: michael@0: (void)mWebBrowser->SetContainerWindow(static_cast(this)); michael@0: michael@0: nsCOMPtr browserBaseWindow = do_QueryInterface(mWebBrowser); michael@0: michael@0: mNativeWindow = WebBrowserChromeUI::CreateNativeWindow(static_cast(this)); michael@0: michael@0: if (!mNativeWindow) michael@0: return NS_ERROR_FAILURE; michael@0: michael@0: browserBaseWindow->InitWindow( mNativeWindow, michael@0: nullptr, michael@0: aX, aY, aCX, aCY); michael@0: browserBaseWindow->Create(); michael@0: michael@0: nsCOMPtr listener(static_cast(this)); michael@0: nsCOMPtr thisListener(do_GetWeakReference(listener)); michael@0: (void)mWebBrowser->AddWebBrowserListener(thisListener, michael@0: NS_GET_IID(nsIWebProgressListener)); michael@0: michael@0: // The window has been created. Now register for history notifications michael@0: mWebBrowser->AddWebBrowserListener(thisListener, NS_GET_IID(nsISHistoryListener)); michael@0: michael@0: if (mWebBrowser) michael@0: { michael@0: *aBrowser = mWebBrowser; michael@0: NS_ADDREF(*aBrowser); michael@0: return NS_OK; michael@0: } michael@0: return NS_ERROR_FAILURE; michael@0: } michael@0: michael@0: //***************************************************************************** michael@0: // WebBrowserChrome::nsISupports michael@0: //***************************************************************************** michael@0: michael@0: NS_IMPL_ADDREF(WebBrowserChrome) michael@0: NS_IMPL_RELEASE(WebBrowserChrome) michael@0: michael@0: NS_INTERFACE_MAP_BEGIN(WebBrowserChrome) michael@0: NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome) michael@0: NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) michael@0: NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome) michael@0: NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow) michael@0: NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) // optional michael@0: NS_INTERFACE_MAP_ENTRY(nsISHistoryListener) michael@0: NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) michael@0: NS_INTERFACE_MAP_ENTRY(nsIObserver) michael@0: NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener) michael@0: NS_INTERFACE_MAP_ENTRY(nsITooltipListener) michael@0: NS_INTERFACE_MAP_END michael@0: michael@0: //***************************************************************************** michael@0: // WebBrowserChrome::nsIInterfaceRequestor michael@0: //***************************************************************************** michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::GetInterface(const nsIID &aIID, void** aInstancePtr) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aInstancePtr); michael@0: michael@0: *aInstancePtr = 0; michael@0: if (aIID.Equals(NS_GET_IID(nsIDOMWindow))) michael@0: { michael@0: if (mWebBrowser) michael@0: { michael@0: return mWebBrowser->GetContentDOMWindow((nsIDOMWindow **) aInstancePtr); michael@0: } michael@0: return NS_ERROR_NOT_INITIALIZED; michael@0: } michael@0: return QueryInterface(aIID, aInstancePtr); michael@0: } michael@0: michael@0: //***************************************************************************** michael@0: // WebBrowserChrome::nsIWebBrowserChrome michael@0: //***************************************************************************** michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::SetStatus(uint32_t aType, const char16_t* aStatus) michael@0: { michael@0: WebBrowserChromeUI::UpdateStatusBarText(this, aStatus); michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::GetWebBrowser(nsIWebBrowser** aWebBrowser) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aWebBrowser); michael@0: *aWebBrowser = mWebBrowser; michael@0: NS_IF_ADDREF(*aWebBrowser); michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::SetWebBrowser(nsIWebBrowser* aWebBrowser) michael@0: { michael@0: mWebBrowser = aWebBrowser; michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::GetChromeFlags(uint32_t* aChromeMask) michael@0: { michael@0: *aChromeMask = mChromeFlags; michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::SetChromeFlags(uint32_t aChromeMask) michael@0: { michael@0: mChromeFlags = aChromeMask; michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::DestroyBrowserWindow(void) michael@0: { michael@0: WebBrowserChromeUI::Destroy(this); michael@0: return NS_OK; michael@0: } michael@0: michael@0: michael@0: // IN: The desired browser client area dimensions. michael@0: NS_IMETHODIMP WebBrowserChrome::SizeBrowserTo(int32_t aWidth, int32_t aHeight) michael@0: { michael@0: /* This isn't exactly correct: we're setting the whole window to michael@0: the size requested for the browser. At time of writing, though, michael@0: it's fine and useful for winEmbed's purposes. */ michael@0: WebBrowserChromeUI::SizeTo(this, aWidth, aHeight); michael@0: mSizeSet = true; michael@0: return NS_OK; michael@0: } michael@0: michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::ShowAsModal(void) michael@0: { michael@0: if (mDependentParent) michael@0: AppCallbacks::EnableChromeWindow(mDependentParent, false); michael@0: michael@0: mContinueModalLoop = true; michael@0: AppCallbacks::RunEventLoop(mContinueModalLoop); michael@0: michael@0: if (mDependentParent) michael@0: AppCallbacks::EnableChromeWindow(mDependentParent, true); michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::IsWindowModal(bool *_retval) michael@0: { michael@0: *_retval = false; michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::ExitModalEventLoop(nsresult aStatus) michael@0: { michael@0: mContinueModalLoop = false; michael@0: return NS_OK; michael@0: } michael@0: michael@0: //***************************************************************************** michael@0: // WebBrowserChrome::nsIWebBrowserChromeFocus michael@0: //***************************************************************************** michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::FocusNextElement() michael@0: { michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::FocusPrevElement() michael@0: { michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: //***************************************************************************** michael@0: // WebBrowserChrome::nsIWebProgressListener michael@0: //***************************************************************************** michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::OnProgressChange(nsIWebProgress *progress, nsIRequest *request, michael@0: int32_t curSelfProgress, int32_t maxSelfProgress, michael@0: int32_t curTotalProgress, int32_t maxTotalProgress) michael@0: { michael@0: WebBrowserChromeUI::UpdateProgress(this, curTotalProgress, maxTotalProgress); michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::OnStateChange(nsIWebProgress *progress, nsIRequest *request, michael@0: uint32_t progressStateFlags, nsresult status) michael@0: { michael@0: if ((progressStateFlags & STATE_START) && (progressStateFlags & STATE_IS_DOCUMENT)) michael@0: { michael@0: WebBrowserChromeUI::UpdateBusyState(this, true); michael@0: } michael@0: michael@0: if ((progressStateFlags & STATE_STOP) && (progressStateFlags & STATE_IS_DOCUMENT)) michael@0: { michael@0: WebBrowserChromeUI::UpdateBusyState(this, false); michael@0: WebBrowserChromeUI::UpdateProgress(this, 0, 100); michael@0: WebBrowserChromeUI::UpdateStatusBarText(this, nullptr); michael@0: ContentFinishedLoading(); michael@0: } michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress* aWebProgress, michael@0: nsIRequest* aRequest, michael@0: nsIURI *location, michael@0: uint32_t aFlags) michael@0: { michael@0: bool isSubFrameLoad = false; // Is this a subframe load michael@0: if (aWebProgress) { michael@0: nsCOMPtr domWindow; michael@0: nsCOMPtr topDomWindow; michael@0: aWebProgress->GetDOMWindow(getter_AddRefs(domWindow)); michael@0: if (domWindow) { // Get root domWindow michael@0: domWindow->GetTop(getter_AddRefs(topDomWindow)); michael@0: } michael@0: if (domWindow != topDomWindow) michael@0: isSubFrameLoad = true; michael@0: } michael@0: if (!isSubFrameLoad) michael@0: WebBrowserChromeUI::UpdateCurrentURI(this); michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: WebBrowserChrome::OnStatusChange(nsIWebProgress* aWebProgress, michael@0: nsIRequest* aRequest, michael@0: nsresult aStatus, michael@0: const char16_t* aMessage) michael@0: { michael@0: WebBrowserChromeUI::UpdateStatusBarText(this, aMessage); michael@0: return NS_OK; michael@0: } michael@0: michael@0: michael@0: michael@0: NS_IMETHODIMP michael@0: WebBrowserChrome::OnSecurityChange(nsIWebProgress *aWebProgress, michael@0: nsIRequest *aRequest, michael@0: uint32_t state) michael@0: { michael@0: return NS_OK; michael@0: } michael@0: michael@0: //***************************************************************************** michael@0: // WebBrowserChrome::nsISHistoryListener michael@0: //***************************************************************************** michael@0: michael@0: NS_IMETHODIMP michael@0: WebBrowserChrome::OnHistoryNewEntry(nsIURI * aNewURI) michael@0: { michael@0: return SendHistoryStatusMessage(aNewURI, "add"); michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: WebBrowserChrome::OnHistoryGoBack(nsIURI * aBackURI, bool * aContinue) michael@0: { michael@0: // For now, let the operation continue michael@0: *aContinue = true; michael@0: return SendHistoryStatusMessage(aBackURI, "back"); michael@0: } michael@0: michael@0: michael@0: NS_IMETHODIMP michael@0: WebBrowserChrome::OnHistoryGoForward(nsIURI * aForwardURI, bool * aContinue) michael@0: { michael@0: // For now, let the operation continue michael@0: *aContinue = true; michael@0: return SendHistoryStatusMessage(aForwardURI, "forward"); michael@0: } michael@0: michael@0: michael@0: NS_IMETHODIMP michael@0: WebBrowserChrome::OnHistoryGotoIndex(int32_t aIndex, nsIURI * aGotoURI, bool * aContinue) michael@0: { michael@0: // For now, let the operation continue michael@0: *aContinue = true; michael@0: return SendHistoryStatusMessage(aGotoURI, "goto", aIndex); michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: WebBrowserChrome::OnHistoryReload(nsIURI * aURI, uint32_t aReloadFlags, bool * aContinue) michael@0: { michael@0: // For now, let the operation continue michael@0: *aContinue = true; michael@0: return SendHistoryStatusMessage(aURI, "reload", 0 /* no info to pass here */, aReloadFlags); michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: WebBrowserChrome::OnHistoryPurge(int32_t aNumEntries, bool *aContinue) michael@0: { michael@0: // For now let the operation continue michael@0: *aContinue = false; michael@0: return SendHistoryStatusMessage(nullptr, "purge", aNumEntries); michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: WebBrowserChrome::OnHistoryReplaceEntry(int32_t aIndex) michael@0: { michael@0: return SendHistoryStatusMessage(nullptr, "replace", aIndex); michael@0: } michael@0: michael@0: static void michael@0: AppendIntToCString(int32_t info1, nsCString& aResult) michael@0: { michael@0: char intstr[10]; michael@0: _snprintf(intstr, sizeof(intstr) - 1, "%i", info1); michael@0: intstr[sizeof(intstr) - 1] = '\0'; michael@0: aResult.Append(intstr); michael@0: } michael@0: michael@0: nsresult michael@0: WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, int32_t info1, uint32_t aReloadFlags) michael@0: { michael@0: nsCString uriSpec; michael@0: if (aURI) michael@0: { michael@0: aURI->GetSpec(uriSpec); michael@0: } michael@0: michael@0: nsCString status; michael@0: michael@0: if(!(strcmp(operation, "back"))) michael@0: { michael@0: status.Assign("Going back to url: "); michael@0: status.Append(uriSpec); michael@0: } michael@0: else if (!(strcmp(operation, "forward"))) michael@0: { michael@0: // Going forward. XXX Get string from a resource file michael@0: status.Assign("Going forward to url: "); michael@0: status.Append(uriSpec); michael@0: } michael@0: else if (!(strcmp(operation, "reload"))) michael@0: { michael@0: // Reloading. XXX Get string from a resource file michael@0: if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY && michael@0: aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE) michael@0: { michael@0: status.Assign("Reloading url, (bypassing proxy and cache): "); michael@0: } michael@0: else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY) michael@0: { michael@0: status.Assign("Reloading url, (bypassing proxy): "); michael@0: } michael@0: else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE) michael@0: { michael@0: status.Assign("Reloading url, (bypassing cache): "); michael@0: } michael@0: else michael@0: { michael@0: status.Assign("Reloading url, (normal): "); michael@0: } michael@0: status.Append(uriSpec); michael@0: } michael@0: else if (!(strcmp(operation, "add"))) michael@0: { michael@0: status.Assign(uriSpec); michael@0: status.Append(" added to session History"); michael@0: } michael@0: else if (!(strcmp(operation, "goto"))) michael@0: { michael@0: status.Assign("Going to HistoryIndex: "); michael@0: michael@0: AppendIntToCString(info1, status); michael@0: michael@0: status.Append(" Url: "); michael@0: status.Append(uriSpec); michael@0: } michael@0: else if (!(strcmp(operation, "purge"))) michael@0: { michael@0: AppendIntToCString(info1, status); michael@0: status.Append(" purged from Session History"); michael@0: } michael@0: else if (!(strcmp(operation, "replace"))) michael@0: { michael@0: status.Assign("Replacing HistoryIndex: "); michael@0: AppendIntToCString(info1, status); michael@0: } michael@0: michael@0: nsString wstatus; michael@0: NS_CStringToUTF16(status, NS_CSTRING_ENCODING_UTF8, wstatus); michael@0: WebBrowserChromeUI::UpdateStatusBarText(this, wstatus.get()); michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: void WebBrowserChrome::ContentFinishedLoading() michael@0: { michael@0: // if it was a chrome window and no one has already specified a size, michael@0: // size to content michael@0: if (mWebBrowser && !mSizeSet && michael@0: (mChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)) { michael@0: nsCOMPtr contentWin; michael@0: mWebBrowser->GetContentDOMWindow(getter_AddRefs(contentWin)); michael@0: if (contentWin) michael@0: contentWin->SizeToContent(); michael@0: WebBrowserChromeUI::ShowWindow(this, true); michael@0: } michael@0: } michael@0: michael@0: michael@0: //***************************************************************************** michael@0: // WebBrowserChrome::nsIEmbeddingSiteWindow michael@0: //***************************************************************************** michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::SetDimensions(uint32_t aFlags, int32_t x, int32_t y, int32_t cx, int32_t cy) michael@0: { michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::GetDimensions(uint32_t aFlags, int32_t *x, int32_t *y, int32_t *cx, int32_t *cy) michael@0: { michael@0: if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) michael@0: { michael@0: *x = 0; michael@0: *y = 0; michael@0: } michael@0: if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER || michael@0: aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER) michael@0: { michael@0: *cx = 0; michael@0: *cy = 0; michael@0: } michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: /* void setFocus (); */ michael@0: NS_IMETHODIMP WebBrowserChrome::SetFocus() michael@0: { michael@0: WebBrowserChromeUI::SetFocus(this); michael@0: return NS_OK; michael@0: } michael@0: michael@0: /* void blur (); */ michael@0: NS_IMETHODIMP WebBrowserChrome::Blur() michael@0: { michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: /* attribute wstring title; */ michael@0: NS_IMETHODIMP WebBrowserChrome::GetTitle(char16_t * *aTitle) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aTitle); michael@0: michael@0: *aTitle = nullptr; michael@0: michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: NS_IMETHODIMP WebBrowserChrome::SetTitle(const char16_t * aTitle) michael@0: { michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: /* attribute boolean visibility; */ michael@0: NS_IMETHODIMP WebBrowserChrome::GetVisibility(bool * aVisibility) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aVisibility); michael@0: *aVisibility = true; michael@0: return NS_OK; michael@0: } michael@0: NS_IMETHODIMP WebBrowserChrome::SetVisibility(bool aVisibility) michael@0: { michael@0: return NS_OK; michael@0: } michael@0: michael@0: /* attribute nativeSiteWindow siteWindow */ michael@0: NS_IMETHODIMP WebBrowserChrome::GetSiteWindow(void * *aSiteWindow) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aSiteWindow); michael@0: michael@0: *aSiteWindow = mNativeWindow; michael@0: return NS_OK; michael@0: } michael@0: michael@0: michael@0: //***************************************************************************** michael@0: // WebBrowserChrome::nsIObserver michael@0: //***************************************************************************** michael@0: michael@0: NS_IMETHODIMP WebBrowserChrome::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *someData) michael@0: { michael@0: nsresult rv = NS_OK; michael@0: if (strcmp(aTopic, "profile-change-teardown") == 0) michael@0: { michael@0: // A profile change means death for this window michael@0: WebBrowserChromeUI::Destroy(this); michael@0: } michael@0: return rv; michael@0: } michael@0: michael@0: //***************************************************************************** michael@0: // WebBrowserChrome::nsIContextMenuListener michael@0: //***************************************************************************** michael@0: michael@0: /* void OnShowContextMenu (in unsigned long aContextFlags, in nsIDOMEvent aEvent, in nsIDOMNode aNode); */ michael@0: NS_IMETHODIMP WebBrowserChrome::OnShowContextMenu(uint32_t aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode) michael@0: { michael@0: WebBrowserChromeUI::ShowContextMenu(this, aContextFlags, aEvent, aNode); michael@0: return NS_OK; michael@0: } michael@0: michael@0: //***************************************************************************** michael@0: // WebBrowserChrome::nsITooltipListener michael@0: //***************************************************************************** michael@0: michael@0: /* void OnShowTooltip (in long aXCoords, in long aYCoords, in wstring aTipText); */ michael@0: NS_IMETHODIMP WebBrowserChrome::OnShowTooltip(int32_t aXCoords, int32_t aYCoords, const char16_t *aTipText) michael@0: { michael@0: WebBrowserChromeUI::ShowTooltip(this, aXCoords, aYCoords, aTipText); michael@0: return NS_OK; michael@0: } michael@0: michael@0: /* void OnHideTooltip (); */ michael@0: NS_IMETHODIMP WebBrowserChrome::OnHideTooltip() michael@0: { michael@0: WebBrowserChromeUI::HideTooltip(this); michael@0: return NS_OK; michael@0: }