Title: [129894] trunk/Source
Revision
129894
Author
[email protected]
Date
2012-09-28 07:16:15 -0700 (Fri, 28 Sep 2012)

Log Message

Unreviewed, rolling out r129825.
http://trac.webkit.org/changeset/129825
https://bugs.webkit.org/show_bug.cgi?id=97474

DOMWindow.resizeTo() is broken. Asked by Mark Pilgrim.

Source/Platform:

* Platform.gypi:
* chromium/public/WebScreenInfo.h: Removed.

Source/WebCore:

* WebCore.gypi:
* platform/Widget.h:
* platform/chromium/PageClientChromium.h: Removed.
* platform/chromium/PlatformScreenChromium.cpp:
(WebCore::screenHorizontalDPI):
(WebCore::screenVerticalDPI):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenIsMonochrome):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/chromium/PlatformSupport.h:
(PlatformSupport):

Source/WebKit/chromium:

* public/WebScreenInfo.h:
(WebKit):
(WebScreenInfo):
(WebKit::WebScreenInfo::WebScreenInfo):
* src/ChromeClientImpl.cpp:
* src/ChromeClientImpl.h:
(WebKit):
(WebKit::ChromeClientImpl::platformPageClient):
(ChromeClientImpl):
* src/PlatformSupport.cpp:
(WebCore::toWebWidgetClient):
(WebCore):
(WebCore::PlatformSupport::screenHorizontalDPI):
(WebCore::PlatformSupport::screenVerticalDPI):
(WebCore::PlatformSupport::screenDepth):
(WebCore::PlatformSupport::screenDepthPerComponent):
(WebCore::PlatformSupport::screenIsMonochrome):
(WebCore::PlatformSupport::screenRect):
(WebCore::PlatformSupport::screenAvailableRect):

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (129893 => 129894)


--- trunk/Source/Platform/ChangeLog	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/Platform/ChangeLog	2012-09-28 14:16:15 UTC (rev 129894)
@@ -1,3 +1,14 @@
+2012-09-28  Kentaro Hara  <[email protected]>
+
+        Unreviewed, rolling out r129825.
+        http://trac.webkit.org/changeset/129825
+        https://bugs.webkit.org/show_bug.cgi?id=97474
+
+        DOMWindow.resizeTo() is broken. Asked by Mark Pilgrim.
+
+        * Platform.gypi:
+        * chromium/public/WebScreenInfo.h: Removed.
+
 2012-09-28  Yoshifumi Inoue  <[email protected]>
 
         [Forms] Add localized strings for multiple fields date/time input UI

Modified: trunk/Source/Platform/Platform.gypi (129893 => 129894)


--- trunk/Source/Platform/Platform.gypi	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/Platform/Platform.gypi	2012-09-28 14:16:15 UTC (rev 129894)
@@ -116,7 +116,6 @@
             'chromium/public/WebRect.h',
             'chromium/public/WebReferrerPolicy.h',
             'chromium/public/WebRenderingStats.h',
-            'chromium/public/WebScreenInfo.h',
             'chromium/public/WebScrollbar.h',
             'chromium/public/WebScrollbarLayer.h',
             'chromium/public/WebScrollbarThemeGeometry.h',

Deleted: trunk/Source/Platform/chromium/public/WebScreenInfo.h (129893 => 129894)


--- trunk/Source/Platform/chromium/public/WebScreenInfo.h	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/Platform/chromium/public/WebScreenInfo.h	2012-09-28 14:16:15 UTC (rev 129894)
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebScreenInfo_h
-#define WebScreenInfo_h
-
-#include "WebRect.h"
-
-namespace WebKit {
-
-struct WebScreenInfo {
-    // The horizontal screen dpi.
-    int horizontalDPI;
-
-    // The vertical screen dpi.
-    int verticalDPI;
-
-    // The screen depth in bits per pixel
-    int depth;
-
-    // The bits per colour component. This assumes that the colours are balanced
-    // equally.
-    int depthPerComponent;
-
-    // This can be true for black and white printers
-    bool isMonochrome;
-
-    // This is set from the rcMonitor member of MONITORINFOEX, to whit:
-    //   "A RECT structure that specifies the display monitor rectangle,
-    //   expressed in virtual-screen coordinates. Note that if the monitor
-    //   is not the primary display monitor, some of the rectangle's
-    //   coordinates may be negative values."
-    WebRect rect;
-
-    // This is set from the rcWork member of MONITORINFOEX, to whit:
-    //   "A RECT structure that specifies the work area rectangle of the
-    //   display monitor that can be used by applications, expressed in
-    //   virtual-screen coordinates. Windows uses this rectangle to
-    //   maximize an application on the monitor. The rest of the area in
-    //   rcMonitor contains system windows such as the task bar and side
-    //   bars. Note that if the monitor is not the primary display monitor,
-    //   some of the rectangle's coordinates may be negative values".
-    WebRect availableRect;
-
-    WebScreenInfo()
-        : horizontalDPI(0)
-        , verticalDPI(0)
-        , depth(0)
-        , depthPerComponent(0)
-        , isMonochrome(false) { }
-};
-
-} // namespace WebKit
-
-#endif

Modified: trunk/Source/WebCore/ChangeLog (129893 => 129894)


--- trunk/Source/WebCore/ChangeLog	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebCore/ChangeLog	2012-09-28 14:16:15 UTC (rev 129894)
@@ -1,3 +1,25 @@
+2012-09-28  Kentaro Hara  <[email protected]>
+
+        Unreviewed, rolling out r129825.
+        http://trac.webkit.org/changeset/129825
+        https://bugs.webkit.org/show_bug.cgi?id=97474
+
+        DOMWindow.resizeTo() is broken. Asked by Mark Pilgrim.
+
+        * WebCore.gypi:
+        * platform/Widget.h:
+        * platform/chromium/PageClientChromium.h: Removed.
+        * platform/chromium/PlatformScreenChromium.cpp:
+        (WebCore::screenHorizontalDPI):
+        (WebCore::screenVerticalDPI):
+        (WebCore::screenDepth):
+        (WebCore::screenDepthPerComponent):
+        (WebCore::screenIsMonochrome):
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        * platform/chromium/PlatformSupport.h:
+        (PlatformSupport):
+
 2012-09-28  Christophe Dumez  <[email protected]>
 
         [WebDatabase] Error code should be CONSTRAINT_ERR if a statement fails due to a constraint failure

Modified: trunk/Source/WebCore/WebCore.gypi (129893 => 129894)


--- trunk/Source/WebCore/WebCore.gypi	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebCore/WebCore.gypi	2012-09-28 14:16:15 UTC (rev 129894)
@@ -4672,7 +4672,6 @@
             'platform/chromium/LinkHashChromium.cpp',
             'platform/chromium/MemoryUsageSupportChromium.cpp',
             'platform/chromium/MIMETypeRegistryChromium.cpp',
-            'platform/chromium/PageClientChromium.h',
             'platform/chromium/PasteboardChromium.cpp',
             'platform/chromium/PlatformCursor.h',
             'platform/chromium/PlatformKeyboardEventChromium.cpp',

Modified: trunk/Source/WebCore/platform/Widget.h (129893 => 129894)


--- trunk/Source/WebCore/platform/Widget.h	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebCore/platform/Widget.h	2012-09-28 14:16:15 UTC (rev 129894)
@@ -32,7 +32,6 @@
 #include <wtf/RefCounted.h>
 
 #if PLATFORM(CHROMIUM)
-#include "PageClientChromium.h"
 #include "PlatformWidget.h"
 #endif
 
@@ -94,8 +93,6 @@
 #elif PLATFORM(EFL)
 class PageClientEfl;
 typedef PageClientEfl* PlatformPageClient;
-#elif PLATFORM(CHROMIUM)
-typedef WebCore::PageClientChromium* PlatformPageClient;
 #else
 typedef PlatformWidget PlatformPageClient;
 #endif

Deleted: trunk/Source/WebCore/platform/chromium/PageClientChromium.h (129893 => 129894)


--- trunk/Source/WebCore/platform/chromium/PageClientChromium.h	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebCore/platform/chromium/PageClientChromium.h	2012-09-28 14:16:15 UTC (rev 129894)
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2012, Google Inc. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PageClientChromium_h
-#define PageClientChromium_h
-
-#include <public/WebScreenInfo.h>
-
-namespace WebCore {
-
-class PageClientChromium {
-public:
-    virtual WebKit::WebScreenInfo screenInfo() = 0;
-};
-
-} // namespace WebCore
-
-#endif // PageClientChromium_h

Modified: trunk/Source/WebCore/platform/chromium/PlatformScreenChromium.cpp (129893 => 129894)


--- trunk/Source/WebCore/platform/chromium/PlatformScreenChromium.cpp	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebCore/platform/chromium/PlatformScreenChromium.cpp	2012-09-28 14:16:15 UTC (rev 129894)
@@ -31,82 +31,46 @@
 #include "config.h"
 #include "PlatformScreen.h"
 
-#include "FloatRect.h"
-#include "HostWindow.h"
-#include "ScrollView.h"
-#include "Widget.h"
+#include "IntRect.h"
+#include "PlatformSupport.h"
+
 #include <public/Platform.h>
-#include <public/WebScreenInfo.h>
 
 namespace WebCore {
 
-static PlatformPageClient toPlatformPageClient(Widget* widget)
-{
-    if (!widget)
-        return 0;
-    ScrollView* root = widget->root();
-    if (!root)
-        return 0;
-    HostWindow* hostWindow = root->hostWindow();
-    if (!hostWindow)
-        return 0;
-    return hostWindow->platformPageClient();
-}
-
 int screenHorizontalDPI(Widget* widget)
 {
-    PlatformPageClient client = toPlatformPageClient(widget);
-    if (!client)
-        return 0;
-    return client->screenInfo().horizontalDPI;
+    return PlatformSupport::screenHorizontalDPI(widget);
 }
 
 int screenVerticalDPI(Widget* widget)
 {
-    PlatformPageClient client = toPlatformPageClient(widget);
-    if (!client)
-        return 0;
-    return client->screenInfo().verticalDPI;
+    return PlatformSupport::screenVerticalDPI(widget);
 }
 
 int screenDepth(Widget* widget)
 {
-    PlatformPageClient client = toPlatformPageClient(widget);
-    if (!client)
-        return 0;
-    return client->screenInfo().depth;
+    return PlatformSupport::screenDepth(widget);
 }
 
 int screenDepthPerComponent(Widget* widget)
 {
-    PlatformPageClient client = toPlatformPageClient(widget);
-    if (!client)
-        return 0;
-    return client->screenInfo().depthPerComponent;
+    return PlatformSupport::screenDepthPerComponent(widget);
 }
 
 bool screenIsMonochrome(Widget* widget)
 {
-    PlatformPageClient client = toPlatformPageClient(widget);
-    if (!client)
-        return 0;
-    return client->screenInfo().isMonochrome;
+    return PlatformSupport::screenIsMonochrome(widget);
 }
 
 FloatRect screenRect(Widget* widget)
 {
-    PlatformPageClient client = toPlatformPageClient(widget);
-    if (!client)
-        return IntRect();
-    return IntRect(client->screenInfo().rect);
+    return PlatformSupport::screenRect(widget);
 }
 
 FloatRect screenAvailableRect(Widget* widget)
 {
-    PlatformPageClient client = toPlatformPageClient(widget);
-    if (!client)
-        return IntRect();
-    return IntRect(client->screenInfo().availableRect);
+    return PlatformSupport::screenAvailableRect(widget);
 }
 
 void screenColorProfile(ColorProfile& toProfile)

Modified: trunk/Source/WebCore/platform/chromium/PlatformSupport.h (129893 => 129894)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-09-28 14:16:15 UTC (rev 129894)
@@ -98,6 +98,15 @@
     static bool plugins(bool refresh, Vector<PluginInfo>*);
     static NPObject* pluginScriptableObject(Widget*);
 
+    // Screen -------------------------------------------------------------
+    static int screenHorizontalDPI(Widget*);
+    static int screenVerticalDPI(Widget*);
+    static int screenDepth(Widget*);
+    static int screenDepthPerComponent(Widget*);
+    static bool screenIsMonochrome(Widget*);
+    static IntRect screenRect(Widget*);
+    static IntRect screenAvailableRect(Widget*);
+
     // Theming ------------------------------------------------------------
 #if OS(WINDOWS)
     static void paintButton(

Modified: trunk/Source/WebKit/chromium/ChangeLog (129893 => 129894)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-09-28 14:16:15 UTC (rev 129894)
@@ -1,3 +1,31 @@
+2012-09-28  Kentaro Hara  <[email protected]>
+
+        Unreviewed, rolling out r129825.
+        http://trac.webkit.org/changeset/129825
+        https://bugs.webkit.org/show_bug.cgi?id=97474
+
+        DOMWindow.resizeTo() is broken. Asked by Mark Pilgrim.
+
+        * public/WebScreenInfo.h:
+        (WebKit):
+        (WebScreenInfo):
+        (WebKit::WebScreenInfo::WebScreenInfo):
+        * src/ChromeClientImpl.cpp:
+        * src/ChromeClientImpl.h:
+        (WebKit):
+        (WebKit::ChromeClientImpl::platformPageClient):
+        (ChromeClientImpl):
+        * src/PlatformSupport.cpp:
+        (WebCore::toWebWidgetClient):
+        (WebCore):
+        (WebCore::PlatformSupport::screenHorizontalDPI):
+        (WebCore::PlatformSupport::screenVerticalDPI):
+        (WebCore::PlatformSupport::screenDepth):
+        (WebCore::PlatformSupport::screenDepthPerComponent):
+        (WebCore::PlatformSupport::screenIsMonochrome):
+        (WebCore::PlatformSupport::screenRect):
+        (WebCore::PlatformSupport::screenAvailableRect):
+
 2012-09-27  Alexander Pavlov  <[email protected]>
 
         Web Inspector: [Device Metrics] Remove the gutter overlay moving its functionality into the InspectorOverlay

Modified: trunk/Source/WebKit/chromium/public/WebScreenInfo.h (129893 => 129894)


--- trunk/Source/WebKit/chromium/public/WebScreenInfo.h	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebKit/chromium/public/WebScreenInfo.h	2012-09-28 14:16:15 UTC (rev 129894)
@@ -28,4 +28,55 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "../../../Platform/chromium/public/WebScreenInfo.h"
+#ifndef WebScreenInfo_h
+#define WebScreenInfo_h
+
+#include "platform/WebRect.h"
+
+namespace WebKit {
+
+struct WebScreenInfo {
+    // The horizontal screen dpi.
+    int horizontalDPI;
+
+    // The vertical screen dpi.
+    int verticalDPI;
+
+    // The screen depth in bits per pixel
+    int depth;
+
+    // The bits per colour component. This assumes that the colours are balanced
+    // equally.
+    int depthPerComponent;
+
+    // This can be true for black and white printers
+    bool isMonochrome;
+
+    // This is set from the rcMonitor member of MONITORINFOEX, to whit:
+    //   "A RECT structure that specifies the display monitor rectangle,
+    //   expressed in virtual-screen coordinates. Note that if the monitor
+    //   is not the primary display monitor, some of the rectangle's
+    //   coordinates may be negative values."
+    WebRect rect;
+
+    // This is set from the rcWork member of MONITORINFOEX, to whit:
+    //   "A RECT structure that specifies the work area rectangle of the
+    //   display monitor that can be used by applications, expressed in
+    //   virtual-screen coordinates. Windows uses this rectangle to
+    //   maximize an application on the monitor. The rest of the area in
+    //   rcMonitor contains system windows such as the task bar and side
+    //   bars. Note that if the monitor is not the primary display monitor,
+    //   some of the rectangle's coordinates may be negative values".
+    WebRect availableRect;
+
+    WebScreenInfo()
+        : horizontalDPI(0)
+        , verticalDPI(0)
+        , depth(0)
+        , depthPerComponent(0)
+        , isMonochrome(false) { }
+};
+
+} // namespace WebKit
+
+#endif

Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp (129893 => 129894)


--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp	2012-09-28 14:16:15 UTC (rev 129894)
@@ -902,12 +902,6 @@
         m_webView->client()->postAccessibilityNotification(WebAccessibilityObject(obj), toWebAccessibilityNotification(notification));
 }
 
-WebKit::WebScreenInfo ChromeClientImpl::screenInfo()
-{
-    return m_webView->client()->screenInfo();
-}
-
-
 bool ChromeClientImpl::paintCustomOverhangArea(GraphicsContext* context, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
 {
     Frame* frame = m_webView->mainFrameImpl()->frame();

Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.h (129893 => 129894)


--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.h	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.h	2012-09-28 14:16:15 UTC (rev 129894)
@@ -60,11 +60,10 @@
 class WebColorChooserClient;
 class WebViewImpl;
 struct WebCursorInfo;
-struct WebScreenInfo;
 struct WebPopupMenuInfo;
 
 // Handles window-level notifications from WebCore on behalf of a WebView.
-class ChromeClientImpl : public WebCore::ChromeClientChromium, public WebCore::PageClientChromium {
+class ChromeClientImpl : public WebCore::ChromeClientChromium {
 public:
     explicit ChromeClientImpl(WebViewImpl* webView);
     virtual ~ChromeClientImpl();
@@ -124,7 +123,7 @@
         const WebCore::IntRect& clipRect);
     virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) const;
     virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) const;
-    virtual PlatformPageClient platformPageClient() const { return PlatformPageClient(this); }
+    virtual PlatformPageClient platformPageClient() const { return 0; }
     virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
     virtual void layoutUpdated(WebCore::Frame*) const;
     virtual void scrollRectIntoView(
@@ -195,9 +194,6 @@
     virtual void popupClosed(WebCore::PopupContainer* popupContainer);
     virtual void postAccessibilityNotification(WebCore::AccessibilityObject*, WebCore::AXObjectCache::AXNotification);
 
-    // PageClientChromium methods:
-    virtual WebScreenInfo screenInfo();
-
     // ChromeClientImpl:
     void setCursorForPlugin(const WebCursorInfo&);
     void setNewWindowNavigationPolicy(WebNavigationPolicy);

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (129893 => 129894)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-09-28 14:12:48 UTC (rev 129893)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-09-28 14:16:15 UTC (rev 129894)
@@ -100,6 +100,30 @@
 
 namespace WebCore {
 
+static WebWidgetClient* toWebWidgetClient(Widget* widget)
+{
+    if (!widget)
+        return 0;
+
+    FrameView* view;
+    if (widget->isFrameView())
+        view = static_cast<FrameView*>(widget);
+    else if (widget->parent() && widget->parent()->isFrameView())
+        view = static_cast<FrameView*>(widget->parent());
+    else
+        return 0;
+
+    Page* page = view->frame() ? view->frame()->page() : 0;
+    if (!page)
+        return 0;
+
+    void* webView = page->chrome()->client()->webView();
+    if (!webView)
+        return 0;
+
+    return static_cast<WebViewImpl*>(webView)->client();
+}
+
 static WebCookieJar* getCookieJar(const Document* document)
 {
     WebFrameImpl* frameImpl = WebFrameImpl::fromFrame(document->frame());
@@ -306,6 +330,62 @@
 // Glue layer. Once the Glue layer moves entirely into the WebKit layer, these
 // methods will be deleted.
 
+int PlatformSupport::screenHorizontalDPI(Widget* widget)
+{
+    WebWidgetClient* client = toWebWidgetClient(widget);
+    if (!client)
+        return 0;
+    return client->screenInfo().horizontalDPI;
+}
+
+int PlatformSupport::screenVerticalDPI(Widget* widget)
+{
+    WebWidgetClient* client = toWebWidgetClient(widget);
+    if (!client)
+        return 0;
+    return client->screenInfo().verticalDPI;
+}
+
+int PlatformSupport::screenDepth(Widget* widget)
+{
+    WebWidgetClient* client = toWebWidgetClient(widget);
+    if (!client)
+        return 0;
+    return client->screenInfo().depth;
+}
+
+int PlatformSupport::screenDepthPerComponent(Widget* widget)
+{
+    WebWidgetClient* client = toWebWidgetClient(widget);
+    if (!client)
+        return 0;
+    return client->screenInfo().depthPerComponent;
+}
+
+bool PlatformSupport::screenIsMonochrome(Widget* widget)
+{
+    WebWidgetClient* client = toWebWidgetClient(widget);
+    if (!client)
+        return 0;
+    return client->screenInfo().isMonochrome;
+}
+
+IntRect PlatformSupport::screenRect(Widget* widget)
+{
+    WebWidgetClient* client = toWebWidgetClient(widget);
+    if (!client)
+        return IntRect();
+    return client->screenInfo().rect;
+}
+
+IntRect PlatformSupport::screenAvailableRect(Widget* widget)
+{
+    WebWidgetClient* client = toWebWidgetClient(widget);
+    if (!client)
+        return IntRect();
+    return client->screenInfo().availableRect;
+}
+
 #if ENABLE(WORKERS)
 WorkerContextProxy* WorkerContextProxy::create(Worker* worker)
 {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to