~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/embedding/tests/wxEmbed/GeckoContainer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ***** BEGIN LICENSE BLOCK *****
 
2
 * Version: Mozilla-sample-code 1.0
 
3
 *
 
4
 * Copyright (c) 2002 Netscape Communications Corporation and
 
5
 * other contributors
 
6
 *
 
7
 * Permission is hereby granted, free of charge, to any person obtaining a
 
8
 * copy of this Mozilla sample software and associated documentation files
 
9
 * (the "Software"), to deal in the Software without restriction, including
 
10
 * without limitation the rights to use, copy, modify, merge, publish,
 
11
 * distribute, sublicense, and/or sell copies of the Software, and to permit
 
12
 * persons to whom the Software is furnished to do so, subject to the
 
13
 * following conditions:
 
14
 *
 
15
 * The above copyright notice and this permission notice shall be included
 
16
 * in all copies or substantial portions of the Software.
 
17
 *
 
18
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
19
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
20
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 
21
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
22
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
23
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
24
 * DEALINGS IN THE SOFTWARE.
 
25
 *
 
26
 * Contributor(s):
 
27
 *
 
28
 *   Adam Lock <adamlock@netscape.com>
 
29
 *
 
30
 * ***** END LICENSE BLOCK ***** */
 
31
 
 
32
// Mozilla Includes
 
33
//#include "nsIGenericFactory.h"
 
34
#include "nsIComponentManager.h"
 
35
#include "nsXPIDLString.h"
 
36
#include "nsIURI.h"
 
37
#include "nsIWebProgress.h"
 
38
#include "nsIDocShellTreeItem.h"
 
39
#include "nsIDOMWindow.h"
 
40
#include "nsIDOMWindowInternal.h"
 
41
#include "nsIInterfaceRequestor.h"
 
42
#include "nsIInterfaceRequestorUtils.h"
 
43
#include "nsIURIContentListener.h"
 
44
#include "nsCWebBrowser.h"
 
45
#include "nsCRT.h"
 
46
 
 
47
#include "GeckoContainer.h"
 
48
 
 
49
 
 
50
 
 
51
GeckoContainer::GeckoContainer(GeckoContainerUI *pUI, const char *aRole) :
 
52
    mUI(pUI),
 
53
    mNativeWindow(nsnull),
 
54
    mSizeSet(PR_FALSE),
 
55
    mIsChromeContainer(PR_FALSE),
 
56
    mIsURIContentListener(PR_TRUE)
 
57
{
 
58
    NS_ASSERTION(mUI, "No GeckoContainerUI! How do you expect this to work???");
 
59
    if (aRole)
 
60
        mRole = aRole;
 
61
}
 
62
 
 
63
GeckoContainer::~GeckoContainer()
 
64
{
 
65
    mUI->Destroyed();
 
66
}
 
67
 
 
68
nsresult GeckoContainer::CreateBrowser(PRInt32 aX, PRInt32 aY,
 
69
                                         PRInt32 aCX, PRInt32 aCY, nativeWindow aParent,
 
70
                                         nsIWebBrowser **aBrowser)
 
71
{
 
72
    NS_ENSURE_ARG_POINTER(aBrowser);
 
73
    *aBrowser = nsnull;
 
74
 
 
75
    nsresult rv;
 
76
    mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
 
77
    if (!mWebBrowser || NS_FAILED(rv))
 
78
        return NS_ERROR_FAILURE;
 
79
 
 
80
    mWebBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome *, this));
 
81
 
 
82
    nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(mWebBrowser);
 
83
    dsti->SetItemType(
 
84
        mIsChromeContainer ?
 
85
            nsIDocShellTreeItem::typeChromeWrapper :
 
86
            nsIDocShellTreeItem::typeContentWrapper);
 
87
 
 
88
    nsCOMPtr<nsIBaseWindow> browserBaseWindow = do_QueryInterface(mWebBrowser);
 
89
 
 
90
    mNativeWindow = aParent;
 
91
 
 
92
    if (!mNativeWindow)
 
93
        return NS_ERROR_FAILURE;
 
94
 
 
95
    browserBaseWindow->InitWindow( mNativeWindow,
 
96
                             nsnull, 
 
97
                             aX, aY, aCX, aCY);
 
98
    browserBaseWindow->Create();
 
99
 
 
100
    nsCOMPtr<nsIWebProgressListener> listener(NS_STATIC_CAST(nsIWebProgressListener*, this));
 
101
    nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
 
102
    (void)mWebBrowser->AddWebBrowserListener(thisListener, 
 
103
        NS_GET_IID(nsIWebProgressListener));
 
104
 
 
105
    if (mIsURIContentListener)
 
106
        mWebBrowser->SetParentURIContentListener(NS_STATIC_CAST(nsIURIContentListener *, this));
 
107
 
 
108
 
 
109
    // The window has been created. Now register for history notifications
 
110
//    mWebBrowser->AddWebBrowserListener(thisListener, NS_GET_IID(nsISHistoryListener));
 
111
 
 
112
    if (mWebBrowser)
 
113
    {
 
114
      *aBrowser = mWebBrowser;
 
115
      NS_ADDREF(*aBrowser);
 
116
      return NS_OK;
 
117
    }
 
118
    return NS_ERROR_FAILURE;
 
119
}
 
120
 
 
121
 
 
122
void GeckoContainer::ContentFinishedLoading()
 
123
{
 
124
  // if it was a chrome window and no one has already specified a size,
 
125
  // size to content
 
126
  if (mWebBrowser && !mSizeSet &&
 
127
     (mChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)) {
 
128
    nsCOMPtr<nsIDOMWindow> contentWin;
 
129
    mWebBrowser->GetContentDOMWindow(getter_AddRefs(contentWin));
 
130
    if (contentWin)
 
131
        contentWin->SizeToContent();
 
132
    mUI->ShowWindow(PR_TRUE);
 
133
  }
 
134
}
 
135
 
 
136
//*****************************************************************************
 
137
// GeckoContainer::nsISupports
 
138
//*****************************************************************************   
 
139
 
 
140
NS_IMPL_ADDREF(GeckoContainer)
 
141
NS_IMPL_RELEASE(GeckoContainer)
 
142
 
 
143
NS_INTERFACE_MAP_BEGIN(GeckoContainer)
 
144
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome)
 
145
   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
 
146
   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
 
147
   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChromeFocus)
 
148
   NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow)
 
149
   NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow2)
 
150
   NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) // optional
 
151
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
 
152
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
 
153
   NS_INTERFACE_MAP_ENTRY(nsIURIContentListener)
 
154
   NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener2)
 
155
   NS_INTERFACE_MAP_ENTRY(nsITooltipListener)
 
156
   NS_INTERFACE_MAP_ENTRY(nsIGeckoContainer)
 
157
NS_INTERFACE_MAP_END
 
158
 
 
159
 
 
160
//*****************************************************************************
 
161
// GeckoContainer::nsIGeckoContainer
 
162
//*****************************************************************************   
 
163
 
 
164
NS_IMETHODIMP GeckoContainer::GetRole(nsACString &aRole)
 
165
{
 
166
    aRole = mRole;
 
167
    return NS_OK;
 
168
}
 
169
 
 
170
NS_IMETHODIMP GeckoContainer::GetContainerUI(GeckoContainerUI **pUI)
 
171
{
 
172
    *pUI = mUI;
 
173
    return NS_OK;
 
174
}
 
175
 
 
176
//*****************************************************************************
 
177
// GeckoContainer::nsIInterfaceRequestor
 
178
//*****************************************************************************   
 
179
 
 
180
NS_IMETHODIMP GeckoContainer::GetInterface(const nsIID &aIID, void** aInstancePtr)
 
181
{
 
182
    NS_ENSURE_ARG_POINTER(aInstancePtr);
 
183
 
 
184
    *aInstancePtr = 0;
 
185
    if (aIID.Equals(NS_GET_IID(nsIDOMWindow)))
 
186
    {
 
187
        if (mWebBrowser)
 
188
        {
 
189
            return mWebBrowser->GetContentDOMWindow((nsIDOMWindow **) aInstancePtr);
 
190
        }
 
191
        return NS_ERROR_NOT_INITIALIZED;
 
192
    }
 
193
    return QueryInterface(aIID, aInstancePtr);
 
194
}
 
195
 
 
196
//*****************************************************************************
 
197
// GeckoContainer::nsIWebBrowserChrome
 
198
//*****************************************************************************   
 
199
 
 
200
NS_IMETHODIMP GeckoContainer::SetStatus(PRUint32 aType, const PRUnichar* aStatus)
 
201
{
 
202
    mUI->UpdateStatusBarText(aStatus);
 
203
    return NS_OK;
 
204
}
 
205
 
 
206
NS_IMETHODIMP GeckoContainer::GetWebBrowser(nsIWebBrowser** aWebBrowser)
 
207
{
 
208
    NS_ENSURE_ARG_POINTER(aWebBrowser);
 
209
    *aWebBrowser = mWebBrowser;
 
210
    NS_IF_ADDREF(*aWebBrowser);
 
211
    return NS_OK;
 
212
}
 
213
 
 
214
NS_IMETHODIMP GeckoContainer::SetWebBrowser(nsIWebBrowser* aWebBrowser)
 
215
{
 
216
    mWebBrowser = aWebBrowser;
 
217
    return NS_OK;
 
218
}
 
219
 
 
220
NS_IMETHODIMP GeckoContainer::GetChromeFlags(PRUint32* aChromeMask)
 
221
{
 
222
    *aChromeMask = mChromeFlags;
 
223
    return NS_OK;
 
224
}
 
225
 
 
226
NS_IMETHODIMP GeckoContainer::SetChromeFlags(PRUint32 aChromeMask)
 
227
{
 
228
    mChromeFlags = aChromeMask;
 
229
    return NS_OK;
 
230
}
 
231
 
 
232
NS_IMETHODIMP GeckoContainer::DestroyBrowserWindow(void)
 
233
{
 
234
    mUI->Destroy();
 
235
    return NS_OK;
 
236
}
 
237
 
 
238
 
 
239
// IN: The desired browser client area dimensions.
 
240
NS_IMETHODIMP GeckoContainer::SizeBrowserTo(PRInt32 aWidth, PRInt32 aHeight)
 
241
{
 
242
  /* This isn't exactly correct: we're setting the whole window to
 
243
     the size requested for the browser. At time of writing, though,
 
244
     it's fine and useful for winEmbed's purposes. */
 
245
  mUI->SizeTo(aWidth, aHeight);
 
246
  mSizeSet = PR_TRUE;
 
247
  return NS_OK;
 
248
}
 
249
 
 
250
 
 
251
NS_IMETHODIMP GeckoContainer::ShowAsModal(void)
 
252
{
 
253
/*  if (mDependentParent)
 
254
    mUI->EnableChromeWindow(mDependentParent, PR_FALSE);
 
255
 
 
256
  mContinueModalLoop = PR_TRUE;
 
257
  mUI->RunEventLoop(mContinueModalLoop);
 
258
 
 
259
  if (mDependentParent)
 
260
    mUI->EnableChromeWindow(mDependentParent, PR_TRUE);
 
261
*/
 
262
  return NS_OK;
 
263
}
 
264
 
 
265
NS_IMETHODIMP GeckoContainer::IsWindowModal(PRBool *_retval)
 
266
{
 
267
    *_retval = PR_FALSE;
 
268
    return NS_ERROR_NOT_IMPLEMENTED;
 
269
}
 
270
 
 
271
NS_IMETHODIMP GeckoContainer::ExitModalEventLoop(nsresult aStatus)
 
272
{
 
273
  mContinueModalLoop = PR_FALSE;
 
274
  return NS_OK;
 
275
}
 
276
 
 
277
//*****************************************************************************
 
278
// GeckoContainer::nsIWebBrowserChromeFocus
 
279
//*****************************************************************************
 
280
 
 
281
NS_IMETHODIMP GeckoContainer::FocusNextElement()
 
282
{
 
283
    return NS_ERROR_NOT_IMPLEMENTED;
 
284
}
 
285
 
 
286
NS_IMETHODIMP GeckoContainer::FocusPrevElement()
 
287
{
 
288
    return NS_ERROR_NOT_IMPLEMENTED;
 
289
}
 
290
 
 
291
//*****************************************************************************
 
292
// GeckoContainer::nsIWebProgressListener
 
293
//*****************************************************************************   
 
294
 
 
295
NS_IMETHODIMP GeckoContainer::OnProgressChange(nsIWebProgress *progress, nsIRequest *request,
 
296
                                                  PRInt32 curSelfProgress, PRInt32 maxSelfProgress,
 
297
                                                  PRInt32 curTotalProgress, PRInt32 maxTotalProgress)
 
298
{
 
299
    mUI->UpdateProgress(curTotalProgress, maxTotalProgress);
 
300
    return NS_OK;
 
301
}
 
302
 
 
303
NS_IMETHODIMP GeckoContainer::OnStateChange(nsIWebProgress *progress, nsIRequest *request,
 
304
                                               PRUint32 progressStateFlags, nsresult status)
 
305
{
 
306
    if ((progressStateFlags & STATE_START) && (progressStateFlags & STATE_IS_DOCUMENT))
 
307
    {
 
308
        mUI->UpdateBusyState(PR_TRUE);
 
309
    }
 
310
 
 
311
    if ((progressStateFlags & STATE_STOP) && (progressStateFlags & STATE_IS_DOCUMENT))
 
312
    {
 
313
        mUI->UpdateBusyState(PR_FALSE);
 
314
        mUI->UpdateProgress(0, 100);
 
315
        mUI->UpdateStatusBarText(nsnull);
 
316
        ContentFinishedLoading();
 
317
    }
 
318
 
 
319
    return NS_OK;
 
320
}
 
321
 
 
322
 
 
323
NS_IMETHODIMP GeckoContainer::OnLocationChange(nsIWebProgress* aWebProgress,
 
324
                                                 nsIRequest* aRequest,
 
325
                                                 nsIURI *location)
 
326
{
 
327
    PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
 
328
    if (aWebProgress)
 
329
    {
 
330
        nsCOMPtr<nsIDOMWindow>  domWindow;
 
331
        nsCOMPtr<nsIDOMWindow>  topDomWindow;
 
332
        aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
 
333
        if (domWindow)
 
334
        {
 
335
            // Get root domWindow
 
336
            domWindow->GetTop(getter_AddRefs(topDomWindow));
 
337
        }
 
338
        if (domWindow != topDomWindow)
 
339
            isSubFrameLoad = PR_TRUE;
 
340
    }
 
341
    if (!isSubFrameLoad)
 
342
        mUI->UpdateCurrentURI();
 
343
    return NS_OK;
 
344
}
 
345
 
 
346
NS_IMETHODIMP 
 
347
GeckoContainer::OnStatusChange(nsIWebProgress* aWebProgress,
 
348
                                 nsIRequest* aRequest,
 
349
                                 nsresult aStatus,
 
350
                                 const PRUnichar* aMessage)
 
351
{
 
352
    mUI->UpdateStatusBarText(aMessage);
 
353
    return NS_OK;
 
354
}
 
355
 
 
356
 
 
357
 
 
358
NS_IMETHODIMP 
 
359
GeckoContainer::OnSecurityChange(nsIWebProgress *aWebProgress, 
 
360
                                    nsIRequest *aRequest, 
 
361
                                    PRUint32 state)
 
362
{
 
363
    return NS_OK;
 
364
}
 
365
 
 
366
 
 
367
//*****************************************************************************
 
368
// GeckoContainer::nsIEmbeddingSiteWindow
 
369
//*****************************************************************************   
 
370
 
 
371
NS_IMETHODIMP GeckoContainer::SetDimensions(PRUint32 aFlags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy)
 
372
{
 
373
    return NS_ERROR_NOT_IMPLEMENTED;
 
374
}
 
375
 
 
376
NS_IMETHODIMP GeckoContainer::GetDimensions(PRUint32 aFlags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy)
 
377
{
 
378
    if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION)
 
379
    {
 
380
        *x = 0;
 
381
        *y = 0;
 
382
    }
 
383
    if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER ||
 
384
        aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER)
 
385
    {
 
386
        *cx = 0;
 
387
        *cy = 0;
 
388
    }
 
389
    return NS_ERROR_NOT_IMPLEMENTED;
 
390
}
 
391
 
 
392
/* void setFocus (); */
 
393
NS_IMETHODIMP GeckoContainer::SetFocus()
 
394
{
 
395
    mUI->SetFocus();
 
396
    return NS_OK;
 
397
}
 
398
 
 
399
/* attribute wstring title; */
 
400
NS_IMETHODIMP GeckoContainer::GetTitle(PRUnichar * *aTitle)
 
401
{
 
402
   NS_ENSURE_ARG_POINTER(aTitle);
 
403
 
 
404
   *aTitle = nsnull;
 
405
   
 
406
   return NS_ERROR_NOT_IMPLEMENTED;
 
407
}
 
408
NS_IMETHODIMP GeckoContainer::SetTitle(const PRUnichar * aTitle)
 
409
{
 
410
    return NS_ERROR_NOT_IMPLEMENTED;
 
411
}
 
412
 
 
413
/* attribute boolean visibility; */
 
414
NS_IMETHODIMP GeckoContainer::GetVisibility(PRBool * aVisibility)
 
415
{
 
416
    NS_ENSURE_ARG_POINTER(aVisibility);
 
417
    *aVisibility = PR_TRUE;
 
418
    return NS_OK;
 
419
}
 
420
NS_IMETHODIMP GeckoContainer::SetVisibility(PRBool aVisibility)
 
421
{
 
422
    return NS_OK;
 
423
}
 
424
 
 
425
/* attribute nativeSiteWindow siteWindow */
 
426
NS_IMETHODIMP GeckoContainer::GetSiteWindow(void * *aSiteWindow)
 
427
{
 
428
   NS_ENSURE_ARG_POINTER(aSiteWindow);
 
429
 
 
430
   *aSiteWindow = mNativeWindow;
 
431
   return NS_OK;
 
432
}
 
433
 
 
434
//*****************************************************************************
 
435
// GeckoContainer::nsIEmbeddingSiteWindow2
 
436
//*****************************************************************************   
 
437
 
 
438
NS_IMETHODIMP GeckoContainer::Blur()
 
439
{
 
440
   mUI->KillFocus();
 
441
   return NS_OK;
 
442
}
 
443
 
 
444
//*****************************************************************************
 
445
// GeckoContainer::nsIObserver
 
446
//*****************************************************************************   
 
447
 
 
448
NS_IMETHODIMP GeckoContainer::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
 
449
{
 
450
    nsresult rv = NS_OK;
 
451
    if (nsCRT::strcmp(aTopic, "profile-change-teardown") == 0)
 
452
    {
 
453
        // A profile change means death for this window
 
454
        mUI->Destroy();
 
455
    }
 
456
    return rv;
 
457
}
 
458
 
 
459
//*****************************************************************************
 
460
// GeckoContainer::nsIURIContentListener
 
461
//*****************************************************************************   
 
462
 
 
463
/* boolean onStartURIOpen (in nsIURI aURI); */
 
464
NS_IMETHODIMP GeckoContainer::OnStartURIOpen(nsIURI *aURI, PRBool *_retval)
 
465
{
 
466
    return NS_ERROR_NOT_IMPLEMENTED;
 
467
}
 
468
 
 
469
/* boolean doContent (in string aContentType, in boolean aIsContentPreferred, in nsIRequest aRequest, out nsIStreamListener aContentHandler); */
 
470
NS_IMETHODIMP GeckoContainer::DoContent(const char *aContentType, PRBool aIsContentPreferred, nsIRequest *aRequest, nsIStreamListener **aContentHandler, PRBool *_retval)
 
471
{
 
472
    return NS_ERROR_NOT_IMPLEMENTED;
 
473
}
 
474
 
 
475
/* boolean isPreferred (in string aContentType, out string aDesiredContentType); */
 
476
NS_IMETHODIMP GeckoContainer::IsPreferred(const char *aContentType, char **aDesiredContentType, PRBool *_retval)
 
477
{
 
478
    return NS_ERROR_NOT_IMPLEMENTED;
 
479
}
 
480
 
 
481
/* boolean canHandleContent (in string aContentType, in boolean aIsContentPreferred, out string aDesiredContentType); */
 
482
NS_IMETHODIMP GeckoContainer::CanHandleContent(const char *aContentType, PRBool aIsContentPreferred, char **aDesiredContentType, PRBool *_retval)
 
483
{
 
484
    return NS_ERROR_NOT_IMPLEMENTED;
 
485
}
 
486
 
 
487
/* attribute nsISupports loadCookie; */
 
488
NS_IMETHODIMP GeckoContainer::GetLoadCookie(nsISupports * *aLoadCookie)
 
489
{
 
490
    return NS_ERROR_NOT_IMPLEMENTED;
 
491
}
 
492
NS_IMETHODIMP GeckoContainer::SetLoadCookie(nsISupports * aLoadCookie)
 
493
{
 
494
    return NS_ERROR_NOT_IMPLEMENTED;
 
495
}
 
496
 
 
497
/* attribute nsIURIContentListener parentContentListener; */
 
498
NS_IMETHODIMP GeckoContainer::GetParentContentListener(nsIURIContentListener * *aParentContentListener)
 
499
{
 
500
    return NS_ERROR_NOT_IMPLEMENTED;
 
501
}
 
502
NS_IMETHODIMP GeckoContainer::SetParentContentListener(nsIURIContentListener * aParentContentListener)
 
503
{
 
504
    return NS_ERROR_NOT_IMPLEMENTED;
 
505
}
 
506
 
 
507
//*****************************************************************************
 
508
// GeckoContainer::nsIContextMenuListener2
 
509
//*****************************************************************************   
 
510
 
 
511
/* void onShowContextMenu (in unsigned long aContextFlags, in nsIContextMenuInfo aUtils); */
 
512
NS_IMETHODIMP GeckoContainer::OnShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aContextMenuInfo)
 
513
{
 
514
    mUI->ShowContextMenu(aContextFlags, aContextMenuInfo);
 
515
    return NS_OK;
 
516
}
 
517
 
 
518
 
 
519
//*****************************************************************************
 
520
// GeckoContainer::nsITooltipListener
 
521
//*****************************************************************************   
 
522
 
 
523
/* void OnShowTooltip (in long aXCoords, in long aYCoords, in wstring aTipText); */
 
524
NS_IMETHODIMP GeckoContainer::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText)
 
525
{
 
526
    mUI->ShowTooltip(aXCoords, aYCoords, aTipText);
 
527
    return NS_OK;
 
528
}
 
529
 
 
530
/* void OnHideTooltip (); */
 
531
NS_IMETHODIMP GeckoContainer::OnHideTooltip()
 
532
{
 
533
    mUI->HideTooltip();
 
534
    return NS_OK;
 
535
}