Changeset 85958 in webkit


Ignore:
Timestamp:
May 6, 2011 10:30:10 AM (13 years ago)
Author:
Adam Roben
Message:

Add a WindowGeometry struct for use in the ScheduleChildWindowGeometryUpdate message

This will make it easier to add more info to this message in the future (like whether the
window is visible).

Fixes <http://webkit.org/b/60374> Adding parameters to ScheduleChildWindowGeometryUpdate
message is tedious

Reviewed by Anders Carlsson.

  • Scripts/webkit2/messages.py:

(struct_or_class): Added WindowGeometry to the list of structs.

  • Shared/win/WindowGeometry.cpp: Added.
  • Shared/win/WindowGeometry.h: Added.
  • win/WebKit2.vcproj: Added new files.
  • UIProcess/PageClient.h:
  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • UIProcess/win/WebPageProxyWin.cpp:

(WebKit::WebPageProxy::scheduleChildWindowGeometryUpdate):

  • UIProcess/win/WebView.cpp:

(WebKit::WebView::scheduleChildWindowGeometryUpdate):
(WebKit::WebView::updateChildWindowGeometries):

  • UIProcess/win/WebView.h:
  • WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:

(WebKit::NetscapePlugin::platformGeometryDidChange):

  • WebProcess/Plugins/PluginController.h:
  • WebProcess/Plugins/PluginView.cpp:

(WebKit::PluginView::scheduleWindowedPluginGeometryUpdate):

  • WebProcess/Plugins/PluginView.h:
  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/win/WebPageWin.cpp:

(WebKit::WebPage::scheduleChildWindowGeometryUpdate):
Changed to use WindowGeometry.

Location:
trunk/Source/WebKit2
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r85956 r85958  
     12011-05-06  Adam Roben  <aroben@apple.com>
     2
     3        Add a WindowGeometry struct for use in the ScheduleChildWindowGeometryUpdate message
     4
     5        This will make it easier to add more info to this message in the future (like whether the
     6        window is visible).
     7
     8        Fixes <http://webkit.org/b/60374> Adding parameters to ScheduleChildWindowGeometryUpdate
     9        message is tedious
     10
     11        Reviewed by Anders Carlsson.
     12
     13        * Scripts/webkit2/messages.py:
     14        (struct_or_class): Added WindowGeometry to the list of structs.
     15
     16        * Shared/win/WindowGeometry.cpp: Added.
     17        * Shared/win/WindowGeometry.h: Added.
     18
     19        * win/WebKit2.vcproj: Added new files.
     20
     21        * UIProcess/PageClient.h:
     22        * UIProcess/WebPageProxy.h:
     23        * UIProcess/WebPageProxy.messages.in:
     24        * UIProcess/win/WebPageProxyWin.cpp:
     25        (WebKit::WebPageProxy::scheduleChildWindowGeometryUpdate):
     26        * UIProcess/win/WebView.cpp:
     27        (WebKit::WebView::scheduleChildWindowGeometryUpdate):
     28        (WebKit::WebView::updateChildWindowGeometries):
     29        * UIProcess/win/WebView.h:
     30        * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
     31        (WebKit::NetscapePlugin::platformGeometryDidChange):
     32        * WebProcess/Plugins/PluginController.h:
     33        * WebProcess/Plugins/PluginView.cpp:
     34        (WebKit::PluginView::scheduleWindowedPluginGeometryUpdate):
     35        * WebProcess/Plugins/PluginView.h:
     36        * WebProcess/WebPage/WebPage.h:
     37        * WebProcess/WebPage/win/WebPageWin.cpp:
     38        (WebKit::WebPage::scheduleChildWindowGeometryUpdate):
     39        Changed to use WindowGeometry.
     40
    1412011-05-06  David Kilzer  <ddkilzer@apple.com>
    242
  • trunk/Source/WebKit2/Scripts/webkit2/messages.py

    r85571 r85958  
    275275        'WebKit::WebPreferencesStore',
    276276        'WebKit::WebProcessCreationParameters',
     277        'WebKit::WindowGeometry',
    277278    ])
    278279
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r85795 r85958  
    5454class WebEditCommandProxy;
    5555class WebPopupMenuProxy;
     56
     57#if PLATFORM(WIN)
     58struct WindowGeometry;
     59#endif
    5660
    5761class PageClient {
     
    140144    virtual HWND nativeWindow() = 0;
    141145    virtual void setGestureReachedScrollingLimit(bool) = 0;
    142     virtual void scheduleChildWindowGeometryUpdate(HWND, const WebCore::IntRect& rectInParentClientCoordinates, const WebCore::IntRect& clipRectInChildClientCoordinates) = 0;
     146    virtual void scheduleChildWindowGeometryUpdate(const WindowGeometry&) = 0;
    143147#endif
    144148
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r85908 r85958  
    112112struct WebPageCreationParameters;
    113113struct WebPopupItem;
     114
     115#if PLATFORM(WIN)
     116struct WindowGeometry;
     117#endif
    114118
    115119#if ENABLE(GESTURE_EVENTS)
     
    736740
    737741#if PLATFORM(WIN)
    738     void scheduleChildWindowGeometryUpdate(uint64_t window, const WebCore::IntRect& rectInParentClientCoordinates, const WebCore::IntRect& clipRectInChildClientCoordinates);
     742    void scheduleChildWindowGeometryUpdate(const WindowGeometry&);
    739743#endif
    740744
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r85908 r85958  
    244244
    245245    # Miscellaneous Windows messages
    246     ScheduleChildWindowGeometryUpdate(uint64_t window, WebCore::IntRect rectInParentClientCoordinates, WebCore::IntRect clipRectInChildClientCoordinates)
     246    ScheduleChildWindowGeometryUpdate(WebKit::WindowGeometry geometry)
    247247#endif
    248248
  • trunk/Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp

    r85860 r85958  
    7171}
    7272
    73 void WebPageProxy::scheduleChildWindowGeometryUpdate(uint64_t window, const IntRect& rectInParentClientCoordinates, const IntRect& clipRectInChildClientCoordinates)
     73void WebPageProxy::scheduleChildWindowGeometryUpdate(const WindowGeometry& geometry)
    7474{
    75     m_pageClient->scheduleChildWindowGeometryUpdate(reinterpret_cast<HWND>(window), rectInParentClientCoordinates, clipRectInChildClientCoordinates);
     75    m_pageClient->scheduleChildWindowGeometryUpdate(geometry);
    7676}
    7777
  • trunk/Source/WebKit2/UIProcess/win/WebView.cpp

    r85808 r85958  
    4343#include "WebPageProxy.h"
    4444#include "WebPopupMenuProxyWin.h"
     45#include "WindowGeometry.h"
    4546#include <Commctrl.h>
    4647#include <WebCore/BitmapInfo.h>
     
    15301531}
    15311532
    1532 void WebView::scheduleChildWindowGeometryUpdate(HWND window, const WebCore::IntRect& rectInParentClientCoordinates, const WebCore::IntRect& clipRectInChildClientCoordinates)
    1533 {
    1534     ChildWindowGeometry geometry;
    1535     geometry.rectInParentClientCoordinates = rectInParentClientCoordinates;
    1536     geometry.clipRectInChildClientCoordinates = clipRectInChildClientCoordinates;
    1537 
    1538     m_childWindowGeometriesToUpdate.set(window, geometry);
     1533void WebView::scheduleChildWindowGeometryUpdate(const WindowGeometry& geometry)
     1534{
     1535    m_childWindowGeometriesToUpdate.set(geometry.window, geometry);
    15391536}
    15401537
     
    15521549void WebView::updateChildWindowGeometries()
    15531550{
    1554     HashMap<HWND, ChildWindowGeometry> geometriesToUpdate;
     1551    HashMap<HWND, WindowGeometry> geometriesToUpdate;
    15551552    geometriesToUpdate.swap(m_childWindowGeometriesToUpdate);
    15561553
    15571554    HDWP deferWindowPos = ::BeginDeferWindowPos(geometriesToUpdate.size());
    15581555
    1559     HashMap<HWND, ChildWindowGeometry>::const_iterator end = geometriesToUpdate.end();
    1560     for (HashMap<HWND, ChildWindowGeometry>::const_iterator it = geometriesToUpdate.begin(); it != end; ++it) {
    1561         HWND window = it->first;
    1562         if (!::IsWindow(window))
     1556    for (HashMap<HWND, WindowGeometry>::const_iterator::Values it = geometriesToUpdate.begin().values(), end = geometriesToUpdate.end().values(); it != end; ++it) {
     1557        const WindowGeometry& geometry = *it;
     1558
     1559        if (!::IsWindow(geometry.window))
    15631560            continue;
    15641561
    1565         const ChildWindowGeometry& geometry = it->second;
    1566 
    1567         const IntRect& windowRect = geometry.rectInParentClientCoordinates;
    1568         deferWindowPos = ::DeferWindowPos(deferWindowPos, window, 0, windowRect.x(), windowRect.y(), windowRect.width(), windowRect.height(), SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
    1569 
    1570         const IntRect& clipRect = geometry.clipRectInChildClientCoordinates;
    1571         setWindowRegion(window, adoptPtr(::CreateRectRgn(clipRect.x(), clipRect.y(), clipRect.maxX(), clipRect.maxY())));
     1562        deferWindowPos = ::DeferWindowPos(deferWindowPos, geometry.window, 0, geometry.frame.x(), geometry.frame.y(), geometry.frame.width(), geometry.frame.height(), SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
     1563
     1564        setWindowRegion(geometry.window, adoptPtr(::CreateRectRgn(geometry.clipRect.x(), geometry.clipRect.y(), geometry.clipRect.maxX(), geometry.clipRect.maxY())));
    15721565    }
    15731566
  • trunk/Source/WebKit2/UIProcess/win/WebView.h

    r85795 r85958  
    212212
    213213    virtual HWND nativeWindow();
    214     virtual void scheduleChildWindowGeometryUpdate(HWND, const WebCore::IntRect& rectInParentClientCoordinates, const WebCore::IntRect& clipRectInChildClientCoordinates);
     214    virtual void scheduleChildWindowGeometryUpdate(const WindowGeometry&);
    215215
    216216    virtual void setGestureReachedScrollingLimit(bool limitReached) { m_gestureReachedScrollingLimit = limitReached; }
     
    269269    bool m_gestureReachedScrollingLimit;
    270270
    271     struct ChildWindowGeometry {
    272         WebCore::IntRect rectInParentClientCoordinates;
    273         WebCore::IntRect clipRectInChildClientCoordinates;
    274     };
    275 
    276     HashMap<HWND, ChildWindowGeometry> m_childWindowGeometriesToUpdate;
     271    HashMap<HWND, WindowGeometry> m_childWindowGeometriesToUpdate;
    277272
    278273#if ENABLE(FULLSCREEN_API)
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp

    r85795 r85958  
    2929#include "PluginController.h"
    3030#include "WebEvent.h"
     31#include "WindowGeometry.h"
    3132#include <WebCore/DefWndProcWindowClass.h>
    3233#include <WebCore/GraphicsContext.h>
     
    152153    ::SetWindowPos(m_window, 0, 0, 0, m_frameRect.width(), m_frameRect.height(), SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER);
    153154
    154     m_pluginController->scheduleWindowedPluginGeometryUpdate(m_window, m_frameRect, clipRectInPluginWindowCoordinates);
     155    WindowGeometry geometry;
     156    geometry.window = m_window;
     157    geometry.frame = m_frameRect;
     158    geometry.clipRect = clipRectInPluginWindowCoordinates;
     159
     160    m_pluginController->scheduleWindowedPluginGeometryUpdate(geometry);
    155161}
    156162
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h

    r85795 r85958  
    3939
    4040namespace WebKit {
     41
     42#if PLATFORM(WIN)
     43struct WindowGeometry;
     44#endif
    4145
    4246class PluginController {
     
    9397    // Tells the controller that the given HWND needs to be positioned and clipped to the given
    9498    // coordinates sometime soon. The controller will decide exactly when this will happen.
    95     virtual void scheduleWindowedPluginGeometryUpdate(HWND, const WebCore::IntRect& rectInParentClientCoordinates, const WebCore::IntRect& clipRectInPluginWindowCoordinates) = 0;
     99    virtual void scheduleWindowedPluginGeometryUpdate(const WindowGeometry&) = 0;
    96100#endif
    97101
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp

    r85795 r85958  
    10051005}
    10061006
    1007 void PluginView::scheduleWindowedPluginGeometryUpdate(HWND pluginWindow, const IntRect& rectInParentClientCoordinates, const IntRect& clipRectInPluginWindowCoordinates)
    1008 {
    1009     m_webPage->scheduleChildWindowGeometryUpdate(pluginWindow, rectInParentClientCoordinates, clipRectInPluginWindowCoordinates);
     1007void PluginView::scheduleWindowedPluginGeometryUpdate(const WindowGeometry& geometry)
     1008{
     1009    m_webPage->scheduleChildWindowGeometryUpdate(geometry);
    10101010}
    10111011#endif
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h

    r85795 r85958  
    133133#if PLATFORM(WIN)
    134134    virtual HWND nativeParentWindow();
    135     virtual void scheduleWindowedPluginGeometryUpdate(HWND, const WebCore::IntRect& rectInClientCoordinates, const WebCore::IntRect& clipRectInPluginWindowCoordinates);
     135    virtual void scheduleWindowedPluginGeometryUpdate(const WindowGeometry&);
    136136#endif
    137137#if PLATFORM(MAC)
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r85806 r85958  
    113113struct WebPreferencesStore;
    114114
     115#if PLATFORM(WIN)
     116struct WindowGeometry;
     117#endif
     118
    115119#if ENABLE(GESTURE_EVENTS)
    116120class WebGestureEvent;
     
    261265#elif PLATFORM(WIN)
    262266    HWND nativeWindow() const { return m_nativeWindow; }
    263     void scheduleChildWindowGeometryUpdate(HWND, const WebCore::IntRect& rectInParentClientCoordinates, const WebCore::IntRect& clipRectInChildClientCoordinates);
     267    void scheduleChildWindowGeometryUpdate(const WindowGeometry&);
    264268#endif
    265269
  • trunk/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp

    r85863 r85958  
    3333#include "WebPreferencesStore.h"
    3434#include "WebProcess.h"
     35#include "WindowGeometry.h"
    3536#include <WebCore/FocusController.h>
    3637#include <WebCore/FontRenderingMode.h>
     
    464465}
    465466
    466 void WebPage::scheduleChildWindowGeometryUpdate(HWND window, const IntRect& rectInParentClientCoordinates, const IntRect& clipRectInChildClientCoordinates)
    467 {
    468     WebProcess::shared().connection()->send(Messages::WebPageProxy::ScheduleChildWindowGeometryUpdate(reinterpret_cast<uint64_t>(window), rectInParentClientCoordinates, clipRectInChildClientCoordinates), m_pageID);
     467void WebPage::scheduleChildWindowGeometryUpdate(const WindowGeometry& geometry)
     468{
     469    WebProcess::shared().connection()->send(Messages::WebPageProxy::ScheduleChildWindowGeometryUpdate(geometry), m_pageID);
    469470}
    470471
  • trunk/Source/WebKit2/win/WebKit2.vcproj

    r85756 r85958  
    12821282                                        </FileConfiguration>
    12831283                                </File>
     1284                                <File
     1285                                        RelativePath="..\Shared\win\WindowGeometry.cpp"
     1286                                        >
     1287                                </File>
     1288                                <File
     1289                                        RelativePath="..\Shared\win\WindowGeometry.h"
     1290                                        >
     1291                                </File>
    12841292                        </Filter>
    12851293                        <Filter
Note: See TracChangeset for help on using the changeset viewer.