Back to index

lightning-sunbird  0.9+nobinonly
WebBrowserChrome.cpp
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: Mozilla-sample-code 1.0
00003  *
00004  * Copyright (c) 2002 Netscape Communications Corporation and
00005  * other contributors
00006  *
00007  * Permission is hereby granted, free of charge, to any person obtaining a
00008  * copy of this Mozilla sample software and associated documentation files
00009  * (the "Software"), to deal in the Software without restriction, including
00010  * without limitation the rights to use, copy, modify, merge, publish,
00011  * distribute, sublicense, and/or sell copies of the Software, and to permit
00012  * persons to whom the Software is furnished to do so, subject to the
00013  * following conditions:
00014  *
00015  * The above copyright notice and this permission notice shall be included
00016  * in all copies or substantial portions of the Software.
00017  *
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00019  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00020  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00021  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00022  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00023  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00024  * DEALINGS IN THE SOFTWARE.
00025  *
00026  * Contributor(s):
00027  *
00028  * ***** END LICENSE BLOCK ***** */
00029 
00030 // Mozilla Includes
00031 #include "nsIGenericFactory.h"
00032 #include "nsIComponentManager.h"
00033 #include "nsString.h"
00034 #include "nsXPIDLString.h"
00035 #include "nsIURI.h"
00036 #include "nsIWebProgress.h"
00037 #include "nsIDocShellTreeItem.h"
00038 #include "nsIDOMWindow.h"
00039 #include "nsIDOMWindowInternal.h"
00040 #include "nsIInterfaceRequestor.h"
00041 #include "nsIInterfaceRequestorUtils.h"
00042 #include "nsIRequest.h"
00043 #include "nsIChannel.h"
00044 #include "nsCWebBrowser.h"
00045 #include "nsWidgetsCID.h"
00046 #include "nsIProfileChangeStatus.h"
00047 #include "nsCRT.h"
00048 
00049 // Local includes
00050 #include "resource.h"
00051 
00052 #include "os2Embed.h"
00053 #include "WebBrowserChrome.h"
00054 
00055 
00056 WebBrowserChrome::WebBrowserChrome()
00057 {
00058     mNativeWindow = nsnull;
00059     mSizeSet = PR_FALSE;
00060 }
00061 
00062 WebBrowserChrome::~WebBrowserChrome()
00063 {
00064     WebBrowserChromeUI::Destroyed(this);
00065 }
00066 
00067 nsresult WebBrowserChrome::CreateBrowser(PRInt32 aX, PRInt32 aY,
00068                                          PRInt32 aCX, PRInt32 aCY,
00069                                          nsIWebBrowser **aBrowser)
00070 {
00071     NS_ENSURE_ARG_POINTER(aBrowser);
00072     *aBrowser = nsnull;
00073 
00074     mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID);
00075     
00076     if (!mWebBrowser)
00077         return NS_ERROR_FAILURE;
00078 
00079     (void)mWebBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome*, this));
00080 
00081     nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(mWebBrowser);
00082     dsti->SetItemType(nsIDocShellTreeItem::typeContentWrapper);
00083 
00084     nsCOMPtr<nsIBaseWindow> browserBaseWindow = do_QueryInterface(mWebBrowser);
00085 
00086     mNativeWindow = WebBrowserChromeUI::CreateNativeWindow(NS_STATIC_CAST(nsIWebBrowserChrome*, this));
00087 
00088     if (!mNativeWindow)
00089         return NS_ERROR_FAILURE;
00090 
00091     browserBaseWindow->InitWindow( mNativeWindow,
00092                              nsnull, 
00093                              aX, aY, aCX, aCY);
00094     browserBaseWindow->Create();
00095 
00096     nsCOMPtr<nsIWebProgressListener> listener(NS_STATIC_CAST(nsIWebProgressListener*, this));
00097     nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
00098     (void)mWebBrowser->AddWebBrowserListener(thisListener, 
00099         NS_GET_IID(nsIWebProgressListener));
00100 
00101     // The window has been created. Now register for history notifications
00102     mWebBrowser->AddWebBrowserListener(thisListener, NS_GET_IID(nsISHistoryListener));
00103 
00104     if (mWebBrowser)
00105     {
00106       *aBrowser = mWebBrowser;
00107       NS_ADDREF(*aBrowser);
00108       return NS_OK;
00109     }
00110     return NS_ERROR_FAILURE;
00111 }
00112 
00113 //*****************************************************************************
00114 // WebBrowserChrome::nsISupports
00115 //*****************************************************************************   
00116 
00117 NS_IMPL_ADDREF(WebBrowserChrome)
00118 NS_IMPL_RELEASE(WebBrowserChrome)
00119 
00120 NS_INTERFACE_MAP_BEGIN(WebBrowserChrome)
00121    NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome)
00122    NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
00123    NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
00124    NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow)
00125    NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) // optional
00126    NS_INTERFACE_MAP_ENTRY(nsISHistoryListener)
00127    NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
00128    NS_INTERFACE_MAP_ENTRY(nsIObserver)
00129    NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener)
00130    NS_INTERFACE_MAP_ENTRY(nsITooltipListener)
00131 NS_INTERFACE_MAP_END
00132 
00133 //*****************************************************************************
00134 // WebBrowserChrome::nsIInterfaceRequestor
00135 //*****************************************************************************   
00136 
00137 NS_IMETHODIMP WebBrowserChrome::GetInterface(const nsIID &aIID, void** aInstancePtr)
00138 {
00139     NS_ENSURE_ARG_POINTER(aInstancePtr);
00140 
00141     *aInstancePtr = 0;
00142     if (aIID.Equals(NS_GET_IID(nsIDOMWindow)))
00143     {
00144         if (mWebBrowser)
00145         {
00146             return mWebBrowser->GetContentDOMWindow((nsIDOMWindow **) aInstancePtr);
00147         }
00148         return NS_ERROR_NOT_INITIALIZED;
00149     }
00150     return QueryInterface(aIID, aInstancePtr);
00151 }
00152 
00153 //*****************************************************************************
00154 // WebBrowserChrome::nsIWebBrowserChrome
00155 //*****************************************************************************   
00156 
00157 NS_IMETHODIMP WebBrowserChrome::SetStatus(PRUint32 aType, const PRUnichar* aStatus)
00158 {
00159     WebBrowserChromeUI::UpdateStatusBarText(this, aStatus);
00160     return NS_OK;
00161 }
00162 
00163 NS_IMETHODIMP WebBrowserChrome::GetWebBrowser(nsIWebBrowser** aWebBrowser)
00164 {
00165     NS_ENSURE_ARG_POINTER(aWebBrowser);
00166     *aWebBrowser = mWebBrowser;
00167     NS_IF_ADDREF(*aWebBrowser);
00168     return NS_OK;
00169 }
00170 
00171 NS_IMETHODIMP WebBrowserChrome::SetWebBrowser(nsIWebBrowser* aWebBrowser)
00172 {
00173     mWebBrowser = aWebBrowser;
00174     return NS_OK;
00175 }
00176 
00177 NS_IMETHODIMP WebBrowserChrome::GetChromeFlags(PRUint32* aChromeMask)
00178 {
00179     *aChromeMask = mChromeFlags;
00180     return NS_OK;
00181 }
00182 
00183 NS_IMETHODIMP WebBrowserChrome::SetChromeFlags(PRUint32 aChromeMask)
00184 {
00185     mChromeFlags = aChromeMask;
00186     return NS_OK;
00187 }
00188 
00189 NS_IMETHODIMP WebBrowserChrome::DestroyBrowserWindow(void)
00190 {
00191     WebBrowserChromeUI::Destroy(this);
00192     return NS_OK;
00193 }
00194 
00195 
00196 // IN: The desired browser client area dimensions.
00197 NS_IMETHODIMP WebBrowserChrome::SizeBrowserTo(PRInt32 aWidth, PRInt32 aHeight)
00198 {
00199   /* This isn't exactly correct: we're setting the whole window to
00200      the size requested for the browser. At time of writing, though,
00201      it's fine and useful for os2Embed's purposes. */
00202   WebBrowserChromeUI::SizeTo(this, aWidth, aHeight);
00203   mSizeSet = PR_TRUE;
00204   return NS_OK;
00205 }
00206 
00207 
00208 NS_IMETHODIMP WebBrowserChrome::ShowAsModal(void)
00209 {
00210   if (mDependentParent)
00211     EnableChromeWindow(mDependentParent, PR_FALSE);
00212 
00213   mContinueModalLoop = PR_TRUE;
00214   RunEventLoop(mContinueModalLoop);
00215 
00216   if (mDependentParent)
00217     EnableChromeWindow(mDependentParent, PR_TRUE);
00218 
00219   return NS_OK;
00220 }
00221 
00222 NS_IMETHODIMP WebBrowserChrome::IsWindowModal(PRBool *_retval)
00223 {
00224     *_retval = PR_FALSE;
00225     return NS_ERROR_NOT_IMPLEMENTED;
00226 }
00227 
00228 NS_IMETHODIMP WebBrowserChrome::ExitModalEventLoop(nsresult aStatus)
00229 {
00230   mContinueModalLoop = PR_FALSE;
00231   return NS_OK;
00232 }
00233 
00234 //*****************************************************************************
00235 // WebBrowserChrome::nsIWebBrowserChromeFocus
00236 //*****************************************************************************
00237 
00238 NS_IMETHODIMP WebBrowserChrome::FocusNextElement()
00239 {
00240     return NS_ERROR_NOT_IMPLEMENTED;
00241 }
00242 
00243 NS_IMETHODIMP WebBrowserChrome::FocusPrevElement()
00244 {
00245     return NS_ERROR_NOT_IMPLEMENTED;
00246 }
00247 
00248 //*****************************************************************************
00249 // WebBrowserChrome::nsIWebProgressListener
00250 //*****************************************************************************   
00251 
00252 NS_IMETHODIMP WebBrowserChrome::OnProgressChange(nsIWebProgress *progress, nsIRequest *request,
00253                                                   PRInt32 curSelfProgress, PRInt32 maxSelfProgress,
00254                                                   PRInt32 curTotalProgress, PRInt32 maxTotalProgress)
00255 {
00256     WebBrowserChromeUI::UpdateProgress(this, curTotalProgress, maxTotalProgress);
00257     return NS_OK;
00258 }
00259 
00260 NS_IMETHODIMP WebBrowserChrome::OnStateChange(nsIWebProgress *progress, nsIRequest *request,
00261                                                PRUint32 progressStateFlags, nsresult status)
00262 {
00263     if ((progressStateFlags & STATE_START) && (progressStateFlags & STATE_IS_DOCUMENT))
00264     {
00265         WebBrowserChromeUI::UpdateBusyState(this, PR_TRUE);
00266     }
00267 
00268     if ((progressStateFlags & STATE_STOP) && (progressStateFlags & STATE_IS_DOCUMENT))
00269     {
00270         WebBrowserChromeUI::UpdateBusyState(this, PR_FALSE);
00271         WebBrowserChromeUI::UpdateProgress(this, 0, 100);
00272         WebBrowserChromeUI::UpdateStatusBarText(this, nsnull);
00273         ContentFinishedLoading();
00274     }
00275 
00276     return NS_OK;
00277 }
00278 
00279 
00280 NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress* aWebProgress,
00281                                                  nsIRequest* aRequest,
00282                                                  nsIURI *location)
00283 {
00284   PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
00285   if (aWebProgress) {
00286     nsCOMPtr<nsIDOMWindow>  domWindow;
00287     nsCOMPtr<nsIDOMWindow>  topDomWindow;
00288     aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
00289     if (domWindow) { // Get root domWindow
00290       domWindow->GetTop(getter_AddRefs(topDomWindow));
00291     }
00292     if (domWindow != topDomWindow)
00293       isSubFrameLoad = PR_TRUE;
00294   }
00295   if (!isSubFrameLoad)
00296     WebBrowserChromeUI::UpdateCurrentURI(this);
00297   return NS_OK;
00298 }
00299 
00300 NS_IMETHODIMP 
00301 WebBrowserChrome::OnStatusChange(nsIWebProgress* aWebProgress,
00302                                  nsIRequest* aRequest,
00303                                  nsresult aStatus,
00304                                  const PRUnichar* aMessage)
00305 {
00306     WebBrowserChromeUI::UpdateStatusBarText(this, aMessage);
00307     return NS_OK;
00308 }
00309 
00310 
00311 
00312 NS_IMETHODIMP 
00313 WebBrowserChrome::OnSecurityChange(nsIWebProgress *aWebProgress, 
00314                                     nsIRequest *aRequest, 
00315                                     PRUint32 state)
00316 {
00317     return NS_OK;
00318 }
00319 
00320 //*****************************************************************************
00321 // WebBrowserChrome::nsISHistoryListener
00322 //*****************************************************************************   
00323 
00324 NS_IMETHODIMP
00325 WebBrowserChrome::OnHistoryNewEntry(nsIURI * aNewURI)
00326 {
00327     return SendHistoryStatusMessage(aNewURI, "add");
00328 }
00329 
00330 NS_IMETHODIMP
00331 WebBrowserChrome::OnHistoryGoBack(nsIURI * aBackURI, PRBool * aContinue)
00332 {
00333     // For now, let the operation continue
00334     *aContinue = PR_TRUE;
00335     return SendHistoryStatusMessage(aBackURI, "back");
00336 }
00337 
00338 
00339 NS_IMETHODIMP
00340 WebBrowserChrome::OnHistoryGoForward(nsIURI * aForwardURI, PRBool * aContinue)
00341 {
00342     // For now, let the operation continue
00343     *aContinue = PR_TRUE;
00344     return SendHistoryStatusMessage(aForwardURI, "forward");
00345 }
00346 
00347 
00348 NS_IMETHODIMP
00349 WebBrowserChrome::OnHistoryGotoIndex(PRInt32 aIndex, nsIURI * aGotoURI, PRBool * aContinue)
00350 {
00351     // For now, let the operation continue
00352     *aContinue = PR_TRUE;
00353     return SendHistoryStatusMessage(aGotoURI, "goto", aIndex);
00354 }
00355 
00356 NS_IMETHODIMP
00357 WebBrowserChrome::OnHistoryReload(nsIURI * aURI, PRUint32 aReloadFlags, PRBool * aContinue)
00358 {
00359     // For now, let the operation continue
00360     *aContinue = PR_TRUE;
00361     return SendHistoryStatusMessage(aURI, "reload", 0 /* no info to pass here */, aReloadFlags);
00362 }
00363 
00364 NS_IMETHODIMP
00365 WebBrowserChrome::OnHistoryPurge(PRInt32 aNumEntries, PRBool *aContinue)
00366 {
00367     // For now let the operation continue
00368     *aContinue = PR_FALSE;
00369     return SendHistoryStatusMessage(nsnull, "purge", aNumEntries);
00370 }
00371 
00372 nsresult
00373 WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, PRInt32 info1, PRUint32 aReloadFlags)
00374 {
00375     nsCAutoString uriCStr;
00376     if (aURI)
00377     {
00378         aURI->GetSpec(uriCStr);
00379     }
00380 
00381     nsString uriAStr;
00382 
00383     if(!(nsCRT::strcmp(operation, "back")))
00384     {
00385         // Going back. XXX Get string from a resource file
00386         uriAStr.AppendLiteral("Going back to url:");
00387         AppendUTF8toUTF16(uriCStr, uriAStr);
00388     }
00389     else if (!(nsCRT::strcmp(operation, "forward")))
00390     {
00391         // Going forward. XXX Get string from a resource file
00392         uriAStr.AppendLiteral("Going forward to url:");
00393         AppendUTF8toUTF16(uriCStr, uriAStr);
00394     }
00395     else if (!(nsCRT::strcmp(operation, "reload")))
00396     {
00397         // Reloading. XXX Get string from a resource file
00398         if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY && 
00399             aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE)
00400         {
00401             uriAStr.Append(NS_LITERAL_STRING("Reloading url,(bypassing proxy and cache) :"));
00402         }
00403         else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY)
00404         {
00405             uriAStr.Append(NS_LITERAL_STRING("Reloading url, (bypassing proxy):"));
00406         }
00407         else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE)
00408         {
00409             uriAStr.Append(NS_LITERAL_STRING("Reloading url, (bypassing cache):"));
00410         }
00411         else
00412         {
00413             uriAStr.Append(NS_LITERAL_STRING("Reloading url, (normal):"));
00414         }
00415         AppendUTF8toUTF16(uriCStr, uriAStr);
00416     }
00417     else if (!(nsCRT::strcmp(operation, "add")))
00418     {
00419         // Adding new entry. XXX Get string from a resource file
00420         AppendUTF8toUTF16(uriCStr, uriAStr);
00421         uriAStr.AppendLiteral(" added to session History");
00422     }
00423     else if (!(nsCRT::strcmp(operation, "goto")))
00424     {
00425         // Goto. XXX Get string from a resource file
00426         uriAStr.AppendLiteral("Going to HistoryIndex:");
00427         uriAStr.AppendInt(info1);
00428         uriAStr.AppendLiteral(" Url:");
00429         AppendUTF8toUTF16(uriCStr, uriAStr);
00430     }
00431     else if (!(nsCRT::strcmp(operation, "purge")))
00432     {
00433         // Purging old entries
00434         uriAStr.AppendInt(info1);
00435         uriAStr.AppendLiteral(" purged from Session History");
00436     }
00437 
00438     WebBrowserChromeUI::UpdateStatusBarText(this, uriAStr.get());
00439 
00440     return NS_OK;
00441 }
00442 
00443 void WebBrowserChrome::ContentFinishedLoading()
00444 {
00445   // if it was a chrome window and no one has already specified a size,
00446   // size to content
00447   if (mWebBrowser && !mSizeSet &&
00448      (mChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)) {
00449     nsCOMPtr<nsIDOMWindow> contentWin;
00450     mWebBrowser->GetContentDOMWindow(getter_AddRefs(contentWin));
00451     if (contentWin)
00452         contentWin->SizeToContent();
00453     WebBrowserChromeUI::ShowWindow(this, PR_TRUE);
00454   }
00455 }
00456 
00457 
00458 //*****************************************************************************
00459 // WebBrowserChrome::nsIEmbeddingSiteWindow
00460 //*****************************************************************************   
00461 
00462 NS_IMETHODIMP WebBrowserChrome::SetDimensions(PRUint32 aFlags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy)
00463 {
00464     return NS_ERROR_NOT_IMPLEMENTED;
00465 }
00466 
00467 NS_IMETHODIMP WebBrowserChrome::GetDimensions(PRUint32 aFlags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy)
00468 {
00469     if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION)
00470     {
00471         *x = 0;
00472         *y = 0;
00473     }
00474     if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER ||
00475         aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER)
00476     {
00477         *cx = 0;
00478         *cy = 0;
00479     }
00480     return NS_ERROR_NOT_IMPLEMENTED;
00481 }
00482 
00483 /* void setFocus (); */
00484 NS_IMETHODIMP WebBrowserChrome::SetFocus()
00485 {
00486     WebBrowserChromeUI::SetFocus(this);
00487     return NS_OK;
00488 }
00489 
00490 /* attribute wstring title; */
00491 NS_IMETHODIMP WebBrowserChrome::GetTitle(PRUnichar * *aTitle)
00492 {
00493    NS_ENSURE_ARG_POINTER(aTitle);
00494 
00495    *aTitle = nsnull;
00496    
00497    return NS_ERROR_NOT_IMPLEMENTED;
00498 }
00499 NS_IMETHODIMP WebBrowserChrome::SetTitle(const PRUnichar * aTitle)
00500 {
00501     return NS_ERROR_NOT_IMPLEMENTED;
00502 }
00503 
00504 /* attribute boolean visibility; */
00505 NS_IMETHODIMP WebBrowserChrome::GetVisibility(PRBool * aVisibility)
00506 {
00507     NS_ENSURE_ARG_POINTER(aVisibility);
00508     *aVisibility = PR_TRUE;
00509     return NS_OK;
00510 }
00511 NS_IMETHODIMP WebBrowserChrome::SetVisibility(PRBool aVisibility)
00512 {
00513     return NS_OK;
00514 }
00515 
00516 /* attribute nativeSiteWindow siteWindow */
00517 NS_IMETHODIMP WebBrowserChrome::GetSiteWindow(void * *aSiteWindow)
00518 {
00519    NS_ENSURE_ARG_POINTER(aSiteWindow);
00520 
00521    *aSiteWindow = mNativeWindow;
00522    return NS_OK;
00523 }
00524 
00525 
00526 //*****************************************************************************
00527 // WebBrowserChrome::nsIObserver
00528 //*****************************************************************************   
00529 
00530 NS_IMETHODIMP WebBrowserChrome::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
00531 {
00532     nsresult rv = NS_OK;
00533     if (nsCRT::strcmp(aTopic, "profile-change-teardown") == 0)
00534     {
00535         // A profile change means death for this window
00536         WebBrowserChromeUI::Destroy(this);
00537     }
00538     return rv;
00539 }
00540 
00541 //*****************************************************************************
00542 // WebBrowserChrome::nsIContextMenuListener
00543 //*****************************************************************************   
00544 
00545 /* void OnShowContextMenu (in unsigned long aContextFlags, in nsIDOMEvent aEvent, in nsIDOMNode aNode); */
00546 NS_IMETHODIMP WebBrowserChrome::OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode)
00547 {
00548     WebBrowserChromeUI::ShowContextMenu(this, aContextFlags, aEvent, aNode);
00549     return NS_OK;
00550 }
00551 
00552 //*****************************************************************************
00553 // WebBrowserChrome::nsITooltipListener
00554 //*****************************************************************************   
00555 
00556 /* void OnShowTooltip (in long aXCoords, in long aYCoords, in wstring aTipText); */
00557 NS_IMETHODIMP WebBrowserChrome::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText)
00558 {
00559     WebBrowserChromeUI::ShowTooltip(this, aXCoords, aYCoords, aTipText);
00560     return NS_OK;
00561 }
00562 
00563 /* void OnHideTooltip (); */
00564 NS_IMETHODIMP WebBrowserChrome::OnHideTooltip()
00565 {
00566     WebBrowserChromeUI::HideTooltip(this);
00567     return NS_OK;
00568 }