Changeset 28505 in webkit


Ignore:
Timestamp:
Dec 6, 2007 6:00:27 PM (16 years ago)
Author:
alice.liu@apple.com
Message:

Fixed <rdar://5540000> onbeforeunload doesn't fire when closing window/tab

Reviewed by Darin.

  • Interfaces/IWebViewPrivate.idl:
  • WebView.cpp: (WebView::shouldClose):
  • WebView.h:
Location:
trunk/WebKit/win
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/win/ChangeLog

    r28503 r28505  
     12007-12-06  Alice Liu  <alice.liu@apple.com>
     2
     3        Fixed <rdar://5540000> onbeforeunload doesn't fire when closing window/tab
     4
     5        Reviewed by Darin.
     6
     7        * Interfaces/IWebViewPrivate.idl:
     8        * WebView.cpp:
     9        (WebView::shouldClose):
     10        * WebView.h:
     11
    1122007-12-06  Adam Roben  <aroben@apple.com>
    213
  • trunk/WebKit/win/Interfaces/IWebViewPrivate.idl

    r28498 r28505  
    128128    // SPI for DumpRenderTree. This is global to all WebViews.
    129129    HRESULT setShouldApplyMacFontAscentHack([in] BOOL shouldApply);
     130
     131    /*!
     132        @method shouldClose:
     133        @abstract This function will fire the before unload handler for a page. 
     134        If the user cancels the closing of a webview from the alert popped up by the
     135        before unload handler, then this function will return false.
     136    */
     137    HRESULT shouldClose([out, retval] BOOL* result);
    130138}
  • trunk/WebKit/win/WebView.cpp

    r28498 r28505  
    41454145}
    41464146
     4147HRESULT STDMETHODCALLTYPE WebView::shouldClose(
     4148    /* [retval][out] */ BOOL* result)
     4149{
     4150    if (!result) {
     4151        ASSERT_NOT_REACHED();
     4152        return E_POINTER;
     4153    }
     4154
     4155    *result = TRUE;
     4156    if (Frame* frame = m_page->focusController()->focusedOrMainFrame())
     4157        *result = frame->shouldClose() ? TRUE : FALSE;
     4158    return S_OK;
     4159}
     4160
    41474161HRESULT WebView::registerDragDrop()
    41484162{
  • trunk/WebKit/win/WebView.h

    r28498 r28505  
    620620
    621621    virtual HRESULT STDMETHODCALLTYPE clearUndoRedoOperations( void);
     622    virtual HRESULT STDMETHODCALLTYPE shouldClose(
     623        /* [retval][out] */ BOOL* result);
    622624
    623625    virtual HRESULT STDMETHODCALLTYPE setProhibitsMainFrameScrolling(BOOL);
Note: See TracChangeset for help on using the changeset viewer.