Changeset 99247 in webkit


Ignore:
Timestamp:
Nov 3, 2011, 4:55:21 PM (14 years ago)
Author:
andersca@apple.com
Message:

Add NetscapePlugin::convertToRootView
https://bugs.webkit.org/show_bug.cgi?id=71519

Reviewed by Darin Adler.

Yet another step towards eliminating uses of m_frameRectInWindowCoordinates.

Also, use the "root view" terminology, since that's really what we mean here.

  • WebProcess/Plugins/Netscape/NetscapePlugin.cpp:

(WebKit::NetscapePlugin::callSetWindow):
Use convertToRootView to get the plug-in location and clip rect in root view coordinates.

(WebKit::NetscapePlugin::convertToRootView):
Apply the m_pluginToRootViewTransform.mapPoint transform.

  • WebProcess/Plugins/Netscape/NetscapePlugin.h:

Add convertToRootView.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r99243 r99247  
     12011-11-03  Anders Carlsson  <andersca@apple.com>
     2
     3        Add NetscapePlugin::convertToRootView
     4        https://bugs.webkit.org/show_bug.cgi?id=71519
     5
     6        Reviewed by Darin Adler.
     7
     8        Yet another step towards eliminating uses of m_frameRectInWindowCoordinates.
     9
     10        Also, use the "root view" terminology, since that's really what we mean here.
     11
     12        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
     13        (WebKit::NetscapePlugin::callSetWindow):
     14        Use convertToRootView to get the plug-in location and clip rect in root view coordinates.
     15
     16        (WebKit::NetscapePlugin::convertToRootView):
     17        Apply the m_pluginToRootViewTransform.mapPoint transform.
     18
     19        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
     20        Add convertToRootView.
     21
    1222011-11-03  Anders Carlsson  <andersca@apple.com>
    223
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp

    r99241 r99247  
    485485{
    486486    if (wantsWindowRelativeNPWindowCoordinates()) {
    487         m_npWindow.x = m_frameRectInWindowCoordinates.x();
    488         m_npWindow.y = m_frameRectInWindowCoordinates.y();
    489         m_npWindow.clipRect.top = m_clipRectInWindowCoordinates.y();
    490         m_npWindow.clipRect.left = m_clipRectInWindowCoordinates.x();
     487        IntPoint pluginLocationInRootViewCoordinates = convertToRootView(IntPoint());
     488        IntPoint clipRectInRootViewCoordinates = convertToRootView(m_clipRect.location());
     489
     490        m_npWindow.x = pluginLocationInRootViewCoordinates.x();
     491        m_npWindow.y = pluginLocationInRootViewCoordinates.y();
     492        m_npWindow.clipRect.top = clipRectInRootViewCoordinates.y();
     493        m_npWindow.clipRect.left = clipRectInRootViewCoordinates.x();
    491494    } else {
    492495        m_npWindow.x = 0;
     
    948951}
    949952
     953IntPoint NetscapePlugin::convertToRootView(const IntPoint& pointInPluginCoordinates) const
     954{
     955    return m_pluginToRootViewTransform.mapPoint(pointInPluginCoordinates);
     956}
     957
    950958} // namespace WebKit
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h

    r99241 r99247  
    218218    bool supportsSnapshotting() const;
    219219
     220    // Convert the given point from plug-in coordinates to root view coordinates.
     221    WebCore::IntPoint convertToRootView(const WebCore::IntPoint&) const;
     222
    220223#if PLUGIN_ARCHITECTURE(WIN)
    221224    static BOOL WINAPI hookedTrackPopupMenu(HMENU, UINT uFlags, int x, int y, int nReserved, HWND, const RECT*);
Note: See TracChangeset for help on using the changeset viewer.