Title: [126803] trunk/Source
Revision
126803
Author
jam...@google.com
Date
2012-08-27 15:01:45 -0700 (Mon, 27 Aug 2012)

Log Message

[chromium] Clean up dependencies of WebScrollbar and WebScrollbarLayer
https://bugs.webkit.org/show_bug.cgi?id=94996

Reviewed by Adrienne Walker.

Source/Platform:

This moves the WebScrollbarLayer::create factory out of #if WEBKIT_IMPLEMENTATION and expresses it in API terms
only so anyone who can get a handle on a WebScrollbar can construct the layer. Also removes the ::create() from
WebScrollbar, anyone who currently has access to a WebCore::Scrollbar also has access to WebScrollbarImpl.

* chromium/public/WebScrollbar.h:
(WebScrollbar):
* chromium/public/WebScrollbarLayer.h:
(WebScrollbarLayer):

Source/WebCore:

Moves WebScrollbarImpl into WebCore/platform/support to make it accessible to chromium-specific WebCore code and
uses it to construct WebScrollbar instances around WebCore::Scrollbars.

* WebCore.gypi:
* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::createScrollbarLayer):
* platform/chromium/support/WebScrollbarImpl.cpp: Renamed from Source/WebKit/chromium/src/WebScrollbarImpl.cpp.
(WebKit):
(WebKit::WebScrollbarImpl::WebScrollbarImpl):
(WebKit::WebScrollbarImpl::isOverlay):
(WebKit::WebScrollbarImpl::value):
(WebKit::WebScrollbarImpl::location):
(WebKit::WebScrollbarImpl::size):
(WebKit::WebScrollbarImpl::enabled):
(WebKit::WebScrollbarImpl::maximum):
(WebKit::WebScrollbarImpl::totalSize):
(WebKit::WebScrollbarImpl::isScrollViewScrollbar):
(WebKit::WebScrollbarImpl::isScrollableAreaActive):
(WebKit::WebScrollbarImpl::getTickmarks):
(WebKit::WebScrollbarImpl::controlSize):
(WebKit::WebScrollbarImpl::pressedPart):
(WebKit::WebScrollbarImpl::hoveredPart):
(WebKit::WebScrollbarImpl::scrollbarOverlayStyle):
(WebKit::WebScrollbarImpl::orientation):
(WebKit::WebScrollbarImpl::isCustomScrollbar):
* platform/chromium/support/WebScrollbarImpl.h: Renamed from Source/WebKit/chromium/src/WebScrollbarImpl.h.
(WebCore):
(WebKit):
(WebScrollbarImpl):

Source/WebKit/chromium:

Fix up tests for API changes.

* WebKit.gyp:
* src/WebScrollbarLayerImpl.cpp:
(WebKit::WebScrollbarLayer::create):
* tests/ScrollbarLayerChromiumTest.cpp:
(WebCore::TEST):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (126802 => 126803)


--- trunk/Source/Platform/ChangeLog	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/Platform/ChangeLog	2012-08-27 22:01:45 UTC (rev 126803)
@@ -1,3 +1,19 @@
+2012-08-24  James Robinson  <jam...@chromium.org>
+
+        [chromium] Clean up dependencies of WebScrollbar and WebScrollbarLayer
+        https://bugs.webkit.org/show_bug.cgi?id=94996
+
+        Reviewed by Adrienne Walker.
+
+        This moves the WebScrollbarLayer::create factory out of #if WEBKIT_IMPLEMENTATION and expresses it in API terms
+        only so anyone who can get a handle on a WebScrollbar can construct the layer. Also removes the ::create() from
+        WebScrollbar, anyone who currently has access to a WebCore::Scrollbar also has access to WebScrollbarImpl.
+
+        * chromium/public/WebScrollbar.h:
+        (WebScrollbar):
+        * chromium/public/WebScrollbarLayer.h:
+        (WebScrollbarLayer):
+
 2012-08-23  James Robinson  <jam...@chromium.org>
 
         [chromium] Convert WebLayerTreeView interface into pure virtual

Modified: trunk/Source/Platform/chromium/public/WebScrollbar.h (126802 => 126803)


--- trunk/Source/Platform/chromium/public/WebScrollbar.h	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/Platform/chromium/public/WebScrollbar.h	2012-08-27 22:01:45 UTC (rev 126803)
@@ -106,10 +106,6 @@
     virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const = 0;
     virtual bool isCustomScrollbar() const = 0;
     virtual Orientation orientation() const = 0;
-
-#if WEBKIT_IMPLEMENTATION
-    WEBKIT_EXPORT static PassOwnPtr<WebScrollbar> create(WebCore::Scrollbar*);
-#endif
 };
 
 } // namespace WebKit

Modified: trunk/Source/Platform/chromium/public/WebScrollbarLayer.h (126802 => 126803)


--- trunk/Source/Platform/chromium/public/WebScrollbarLayer.h	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/Platform/chromium/public/WebScrollbarLayer.h	2012-08-27 22:01:45 UTC (rev 126803)
@@ -38,15 +38,14 @@
 
 class WebScrollbarLayer {
 public:
+    // This takes ownership of the provided WebScrollbar and WebScrollbarThemeGeometry.
+    WEBKIT_EXPORT static WebScrollbarLayer* create(WebScrollbar*, WebScrollbarThemePainter, WebScrollbarThemeGeometry*);
+
     virtual ~WebScrollbarLayer() { }
 
     virtual WebLayer* layer() = 0;
 
     virtual void setScrollLayer(WebLayer*) = 0;
-
-#if WEBKIT_IMPLEMENTATION
-    WEBKIT_EXPORT static WebScrollbarLayer* create(WebCore::Scrollbar*, WebScrollbarThemePainter, PassOwnPtr<WebScrollbarThemeGeometry>);
-#endif
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebCore/ChangeLog (126802 => 126803)


--- trunk/Source/WebCore/ChangeLog	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/WebCore/ChangeLog	2012-08-27 22:01:45 UTC (rev 126803)
@@ -1,3 +1,40 @@
+2012-08-24  James Robinson  <jam...@chromium.org>
+
+        [chromium] Clean up dependencies of WebScrollbar and WebScrollbarLayer
+        https://bugs.webkit.org/show_bug.cgi?id=94996
+
+        Reviewed by Adrienne Walker.
+
+        Moves WebScrollbarImpl into WebCore/platform/support to make it accessible to chromium-specific WebCore code and
+        uses it to construct WebScrollbar instances around WebCore::Scrollbars.
+
+        * WebCore.gypi:
+        * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
+        (WebCore::createScrollbarLayer):
+        * platform/chromium/support/WebScrollbarImpl.cpp: Renamed from Source/WebKit/chromium/src/WebScrollbarImpl.cpp.
+        (WebKit):
+        (WebKit::WebScrollbarImpl::WebScrollbarImpl):
+        (WebKit::WebScrollbarImpl::isOverlay):
+        (WebKit::WebScrollbarImpl::value):
+        (WebKit::WebScrollbarImpl::location):
+        (WebKit::WebScrollbarImpl::size):
+        (WebKit::WebScrollbarImpl::enabled):
+        (WebKit::WebScrollbarImpl::maximum):
+        (WebKit::WebScrollbarImpl::totalSize):
+        (WebKit::WebScrollbarImpl::isScrollViewScrollbar):
+        (WebKit::WebScrollbarImpl::isScrollableAreaActive):
+        (WebKit::WebScrollbarImpl::getTickmarks):
+        (WebKit::WebScrollbarImpl::controlSize):
+        (WebKit::WebScrollbarImpl::pressedPart):
+        (WebKit::WebScrollbarImpl::hoveredPart):
+        (WebKit::WebScrollbarImpl::scrollbarOverlayStyle):
+        (WebKit::WebScrollbarImpl::orientation):
+        (WebKit::WebScrollbarImpl::isCustomScrollbar):
+        * platform/chromium/support/WebScrollbarImpl.h: Renamed from Source/WebKit/chromium/src/WebScrollbarImpl.h.
+        (WebCore):
+        (WebKit):
+        (WebScrollbarImpl):
+
 2012-08-27  Tony Chang  <t...@chromium.org>
 
         Make RenderBox::computePositionedLogicalHeight const

Modified: trunk/Source/WebCore/WebCore.gypi (126802 => 126803)


--- trunk/Source/WebCore/WebCore.gypi	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/WebCore/WebCore.gypi	2012-08-27 22:01:45 UTC (rev 126803)
@@ -8325,6 +8325,8 @@
             'platform/chromium/support/WebRTCConfiguration.cpp',
             'platform/chromium/support/WebScrollbarThemeGeometryNative.cpp',
             'platform/chromium/support/WebScrollbarThemeGeometryNative.h',
+            'platform/chromium/support/WebScrollbarImpl.cpp',
+            'platform/chromium/support/WebScrollbarImpl.h',
             'platform/chromium/support/WebSharedGraphicsContext3D.cpp',
             'platform/chromium/support/WebThreadSafeData.cpp',
             'platform/chromium/support/WebTransformOperations.cpp',

Modified: trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp (126802 => 126803)


--- trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp	2012-08-27 22:01:45 UTC (rev 126803)
@@ -34,6 +34,7 @@
 #include "RenderLayerCompositor.h"
 #include "RenderView.h"
 #include "ScrollbarThemeComposite.h"
+#include "WebScrollbarImpl.h"
 #include "WebScrollbarThemeGeometryNative.h"
 #include <public/WebScrollbar.h>
 #include <public/WebScrollbarLayer.h>
@@ -153,7 +154,7 @@
     WebKit::WebScrollbarThemePainter painter(themeComposite, scrollbar);
     OwnPtr<WebKit::WebScrollbarThemeGeometry> geometry(WebKit::WebScrollbarThemeGeometryNative::create(themeComposite));
 
-    OwnPtr<WebScrollbarLayer> scrollbarLayer = adoptPtr(WebScrollbarLayer::create(scrollbar, painter, geometry.release()));
+    OwnPtr<WebScrollbarLayer> scrollbarLayer = adoptPtr(WebScrollbarLayer::create(new WebKit::WebScrollbarImpl(scrollbar), painter, geometry.leakPtr()));
     scrollbarLayer->setScrollLayer(scrollLayer);
 
     scrollbarGraphicsLayer->setContentsToMedia(scrollbarLayer->layer());

Copied: trunk/Source/WebCore/platform/chromium/support/WebScrollbarImpl.cpp (from rev 126802, trunk/Source/WebKit/chromium/src/WebScrollbarImpl.cpp) (0 => 126803)


--- trunk/Source/WebCore/platform/chromium/support/WebScrollbarImpl.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/chromium/support/WebScrollbarImpl.cpp	2012-08-27 22:01:45 UTC (rev 126803)
@@ -0,0 +1,126 @@
+/*
+ * 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:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#include "config.h"
+
+#include "WebScrollbarImpl.h"
+
+#include "IntRect.h"
+#include "Scrollbar.h"
+
+namespace WebKit {
+
+WebScrollbarImpl::WebScrollbarImpl(WebCore::Scrollbar* scrollbar)
+    : m_scrollbar(scrollbar)
+{
+}
+
+bool WebScrollbarImpl::isOverlay() const
+{
+    return m_scrollbar->isOverlayScrollbar();
+}
+
+int WebScrollbarImpl::value() const
+{
+    return m_scrollbar->value();
+}
+
+WebPoint WebScrollbarImpl::location() const
+{
+    return m_scrollbar->location();
+}
+
+WebSize WebScrollbarImpl::size() const
+{
+    return m_scrollbar->size();
+}
+
+bool WebScrollbarImpl::enabled() const
+{
+    return m_scrollbar->enabled();
+}
+
+int WebScrollbarImpl::maximum() const
+{
+    return m_scrollbar->maximum();
+}
+
+int WebScrollbarImpl::totalSize() const
+{
+    return m_scrollbar->totalSize();
+}
+
+bool WebScrollbarImpl::isScrollViewScrollbar() const
+{
+    return m_scrollbar->isScrollViewScrollbar();
+}
+
+bool WebScrollbarImpl::isScrollableAreaActive() const
+{
+    return m_scrollbar->isScrollableAreaActive();
+}
+
+void WebScrollbarImpl::getTickmarks(WebVector<WebRect>& webTickmarks) const
+{
+    Vector<WebCore::IntRect> tickmarks;
+    m_scrollbar->getTickmarks(tickmarks);
+
+    WebVector<WebRect> result(tickmarks.size());
+    for (size_t i = 0; i < tickmarks.size(); ++i)
+        result[i] = tickmarks[i];
+
+    webTickmarks.swap(result);
+}
+
+WebScrollbar::ScrollbarControlSize WebScrollbarImpl::controlSize() const
+{
+    return static_cast<WebScrollbar::ScrollbarControlSize>(m_scrollbar->controlSize());
+}
+
+WebScrollbar::ScrollbarPart WebScrollbarImpl::pressedPart() const
+{
+    return static_cast<WebScrollbar::ScrollbarPart>(m_scrollbar->pressedPart());
+}
+
+WebScrollbar::ScrollbarPart WebScrollbarImpl::hoveredPart() const
+{
+    return static_cast<WebScrollbar::ScrollbarPart>(m_scrollbar->hoveredPart());
+}
+
+WebScrollbar::ScrollbarOverlayStyle WebScrollbarImpl::scrollbarOverlayStyle() const
+{
+    return static_cast<WebScrollbar::ScrollbarOverlayStyle>(m_scrollbar->scrollbarOverlayStyle());
+}
+
+WebScrollbar::Orientation WebScrollbarImpl::orientation() const
+{
+    return static_cast<WebScrollbar::Orientation>(m_scrollbar->orientation());
+}
+
+bool WebScrollbarImpl::isCustomScrollbar() const
+{
+    return m_scrollbar->isCustomScrollbar();
+}
+
+} // namespace WebKit

Property changes: trunk/Source/WebCore/platform/chromium/support/WebScrollbarImpl.cpp


Added: svn:eol-style

Copied: trunk/Source/WebCore/platform/chromium/support/WebScrollbarImpl.h (from rev 126802, trunk/Source/WebKit/chromium/src/WebScrollbarImpl.h) (0 => 126803)


--- trunk/Source/WebCore/platform/chromium/support/WebScrollbarImpl.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/chromium/support/WebScrollbarImpl.h	2012-08-27 22:01:45 UTC (rev 126803)
@@ -0,0 +1,64 @@
+/*
+ * 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:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 WebScrollbarImpl_h
+#define WebScrollbarImpl_h
+
+#include <public/WebScrollbar.h>
+
+namespace WebCore {
+class Scrollbar;
+}
+
+namespace WebKit {
+
+class WebScrollbarImpl : public WebScrollbar {
+public:
+    explicit WebScrollbarImpl(WebCore::Scrollbar*);
+
+    // Implement WebKit::WebScrollbar methods
+    virtual bool isOverlay() const OVERRIDE;
+    virtual int value() const OVERRIDE;
+    virtual WebPoint location() const OVERRIDE;
+    virtual WebSize size() const OVERRIDE;
+    virtual bool enabled() const OVERRIDE;
+    virtual int maximum() const OVERRIDE;
+    virtual int totalSize() const OVERRIDE;
+    virtual bool isScrollViewScrollbar() const OVERRIDE;
+    virtual bool isScrollableAreaActive() const OVERRIDE;
+    virtual void getTickmarks(WebVector<WebRect>& tickmarks) const OVERRIDE;
+    virtual ScrollbarControlSize controlSize() const OVERRIDE;
+    virtual ScrollbarPart pressedPart() const OVERRIDE;
+    virtual ScrollbarPart hoveredPart() const OVERRIDE;
+    virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const OVERRIDE;
+    virtual Orientation orientation() const OVERRIDE;
+    virtual bool isCustomScrollbar() const OVERRIDE;
+
+private:
+    RefPtr<WebCore::Scrollbar> m_scrollbar;
+};
+
+} // namespace WebKit
+
+#endif

Property changes: trunk/Source/WebCore/platform/chromium/support/WebScrollbarImpl.h


Added: svn:eol-style

Modified: trunk/Source/WebKit/chromium/ChangeLog (126802 => 126803)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-27 22:01:45 UTC (rev 126803)
@@ -1,3 +1,18 @@
+2012-08-24  James Robinson  <jam...@chromium.org>
+
+        [chromium] Clean up dependencies of WebScrollbar and WebScrollbarLayer
+        https://bugs.webkit.org/show_bug.cgi?id=94996
+
+        Reviewed by Adrienne Walker.
+
+        Fix up tests for API changes.
+
+        * WebKit.gyp:
+        * src/WebScrollbarLayerImpl.cpp:
+        (WebKit::WebScrollbarLayer::create):
+        * tests/ScrollbarLayerChromiumTest.cpp:
+        (WebCore::TEST):
+
 2012-08-27  Adrienne Walker  <e...@google.com>
 
         [chromium] Prevent scrollbar thumb size from changing during compositor zoom

Modified: trunk/Source/WebKit/chromium/WebKit.gyp (126802 => 126803)


--- trunk/Source/WebKit/chromium/WebKit.gyp	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/WebKit/chromium/WebKit.gyp	2012-08-27 22:01:45 UTC (rev 126803)
@@ -605,8 +605,6 @@
                 'src/WebScopedMicrotaskSuppression.cpp',
                 'src/WebScopedUserGesture.cpp',
                 'src/WebScriptController.cpp',
-                'src/WebScrollbarImpl.cpp',
-                'src/WebScrollbarImpl.h',
                 'src/WebScrollbarThemeClientImpl.cpp',
                 'src/WebScrollbarThemeClientImpl.h',
                 'src/WebScrollbarThemePainter.cpp',

Deleted: trunk/Source/WebKit/chromium/src/WebScrollbarImpl.cpp (126802 => 126803)


--- trunk/Source/WebKit/chromium/src/WebScrollbarImpl.cpp	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/WebKit/chromium/src/WebScrollbarImpl.cpp	2012-08-27 22:01:45 UTC (rev 126803)
@@ -1,131 +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:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-#include "config.h"
-
-#include "WebScrollbarImpl.h"
-
-#include "IntRect.h"
-#include "Scrollbar.h"
-
-namespace WebKit {
-
-PassOwnPtr<WebScrollbar> WebScrollbar::create(WebCore::Scrollbar* scrollbar)
-{
-    return adoptPtr(new WebScrollbarImpl(scrollbar));
-}
-
-WebScrollbarImpl::WebScrollbarImpl(WebCore::Scrollbar* scrollbar)
-    : m_scrollbar(scrollbar)
-{
-}
-
-bool WebScrollbarImpl::isOverlay() const
-{
-    return m_scrollbar->isOverlayScrollbar();
-}
-
-int WebScrollbarImpl::value() const
-{
-    return m_scrollbar->value();
-}
-
-WebPoint WebScrollbarImpl::location() const
-{
-    return m_scrollbar->location();
-}
-
-WebSize WebScrollbarImpl::size() const
-{
-    return m_scrollbar->size();
-}
-
-bool WebScrollbarImpl::enabled() const
-{
-    return m_scrollbar->enabled();
-}
-
-int WebScrollbarImpl::maximum() const
-{
-    return m_scrollbar->maximum();
-}
-
-int WebScrollbarImpl::totalSize() const
-{
-    return m_scrollbar->totalSize();
-}
-
-bool WebScrollbarImpl::isScrollViewScrollbar() const
-{
-    return m_scrollbar->isScrollViewScrollbar();
-}
-
-bool WebScrollbarImpl::isScrollableAreaActive() const
-{
-    return m_scrollbar->isScrollableAreaActive();
-}
-
-void WebScrollbarImpl::getTickmarks(WebVector<WebRect>& webTickmarks) const
-{
-    Vector<WebCore::IntRect> tickmarks;
-    m_scrollbar->getTickmarks(tickmarks);
-
-    WebVector<WebRect> result(tickmarks.size());
-    for (size_t i = 0; i < tickmarks.size(); ++i)
-        result[i] = tickmarks[i];
-
-    webTickmarks.swap(result);
-}
-
-WebScrollbar::ScrollbarControlSize WebScrollbarImpl::controlSize() const
-{
-    return static_cast<WebScrollbar::ScrollbarControlSize>(m_scrollbar->controlSize());
-}
-
-WebScrollbar::ScrollbarPart WebScrollbarImpl::pressedPart() const
-{
-    return static_cast<WebScrollbar::ScrollbarPart>(m_scrollbar->pressedPart());
-}
-
-WebScrollbar::ScrollbarPart WebScrollbarImpl::hoveredPart() const
-{
-    return static_cast<WebScrollbar::ScrollbarPart>(m_scrollbar->hoveredPart());
-}
-
-WebScrollbar::ScrollbarOverlayStyle WebScrollbarImpl::scrollbarOverlayStyle() const
-{
-    return static_cast<WebScrollbar::ScrollbarOverlayStyle>(m_scrollbar->scrollbarOverlayStyle());
-}
-
-WebScrollbar::Orientation WebScrollbarImpl::orientation() const
-{
-    return static_cast<WebScrollbar::Orientation>(m_scrollbar->orientation());
-}
-
-bool WebScrollbarImpl::isCustomScrollbar() const
-{
-    return m_scrollbar->isCustomScrollbar();
-}
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit/chromium/src/WebScrollbarImpl.h (126802 => 126803)


--- trunk/Source/WebKit/chromium/src/WebScrollbarImpl.h	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/WebKit/chromium/src/WebScrollbarImpl.h	2012-08-27 22:01:45 UTC (rev 126803)
@@ -1,64 +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:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 WebScrollbarImpl_h
-#define WebScrollbarImpl_h
-
-#include <public/WebScrollbar.h>
-
-namespace WebCore {
-class Scrollbar;
-}
-
-namespace WebKit {
-
-class WebScrollbarImpl : public WebScrollbar {
-public:
-    WebScrollbarImpl(WebCore::Scrollbar*);
-
-    // Implement WebKit::WebScrollbar methods
-    virtual bool isOverlay() const OVERRIDE;
-    virtual int value() const OVERRIDE;
-    virtual WebPoint location() const OVERRIDE;
-    virtual WebSize size() const OVERRIDE;
-    virtual bool enabled() const OVERRIDE;
-    virtual int maximum() const OVERRIDE;
-    virtual int totalSize() const OVERRIDE;
-    virtual bool isScrollViewScrollbar() const OVERRIDE;
-    virtual bool isScrollableAreaActive() const OVERRIDE;
-    virtual void getTickmarks(WebVector<WebRect>& tickmarks) const OVERRIDE;
-    virtual ScrollbarControlSize controlSize() const OVERRIDE;
-    virtual ScrollbarPart pressedPart() const OVERRIDE;
-    virtual ScrollbarPart hoveredPart() const OVERRIDE;
-    virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const OVERRIDE;
-    virtual Orientation orientation() const OVERRIDE;
-    virtual bool isCustomScrollbar() const OVERRIDE;
-
-private:
-    RefPtr<WebCore::Scrollbar> m_scrollbar;
-};
-
-} // namespace WebKit
-
-#endif

Modified: trunk/Source/WebKit/chromium/src/WebScrollbarLayerImpl.cpp (126802 => 126803)


--- trunk/Source/WebKit/chromium/src/WebScrollbarLayerImpl.cpp	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/WebKit/chromium/src/WebScrollbarLayerImpl.cpp	2012-08-27 22:01:45 UTC (rev 126803)
@@ -29,14 +29,13 @@
 #include "ScrollbarLayerChromium.h"
 #include "WebLayerImpl.h"
 
-using WebCore::Scrollbar;
 using WebCore::ScrollbarLayerChromium;
 
 namespace WebKit {
 
-WebScrollbarLayer* WebScrollbarLayer::create(WebCore::Scrollbar* scrollbar, WebScrollbarThemePainter painter, PassOwnPtr<WebScrollbarThemeGeometry> geometry)
+WebScrollbarLayer* WebScrollbarLayer::create(WebScrollbar* scrollbar, WebScrollbarThemePainter painter, WebScrollbarThemeGeometry* geometry)
 {
-    return new WebScrollbarLayerImpl(ScrollbarLayerChromium::create(WebScrollbar::create(scrollbar), painter, geometry, 0));
+    return new WebScrollbarLayerImpl(ScrollbarLayerChromium::create(adoptPtr(scrollbar), painter, adoptPtr(geometry), 0));
 }
 
 

Modified: trunk/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp (126802 => 126803)


--- trunk/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp	2012-08-27 21:57:27 UTC (rev 126802)
+++ trunk/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp	2012-08-27 22:01:45 UTC (rev 126803)
@@ -33,6 +33,7 @@
 #include "Scrollbar.h"
 #include "Settings.h"
 #include "TreeSynchronizer.h"
+#include "WebScrollbarImpl.h"
 #include <gtest/gtest.h>
 #include <public/WebScrollbar.h>
 #include <public/WebScrollbarThemeGeometry.h>
@@ -103,7 +104,7 @@
 
     Settings::setMockScrollbarsEnabled(true);
     {
-        OwnPtr<WebKit::WebScrollbar> scrollbar = WebKit::WebScrollbar::create(mockScrollbar.get());
+        OwnPtr<WebKit::WebScrollbar> scrollbar = adoptPtr(new WebKit::WebScrollbarImpl(mockScrollbar.get()));
         RefPtr<LayerChromium> layerTreeRoot = LayerChromium::create();
         RefPtr<LayerChromium> child1 = LayerChromium::create();
         RefPtr<LayerChromium> child2 = ScrollbarLayerChromium::create(scrollbar.release(), painter, WebKit::FakeWebScrollbarThemeGeometry::create(), child1->id());
@@ -120,7 +121,7 @@
     }
 
     { // another traverse order
-        OwnPtr<WebKit::WebScrollbar> scrollbar = WebKit::WebScrollbar::create(mockScrollbar.get());
+        OwnPtr<WebKit::WebScrollbar> scrollbar = adoptPtr(new WebKit::WebScrollbarImpl(mockScrollbar.get()));
         RefPtr<LayerChromium> layerTreeRoot = LayerChromium::create();
         RefPtr<LayerChromium> child2 = LayerChromium::create();
         RefPtr<LayerChromium> child1 = ScrollbarLayerChromium::create(scrollbar.release(), painter, WebKit::FakeWebScrollbarThemeGeometry::create(), child2->id());
@@ -146,7 +147,7 @@
 
     Settings::setMockScrollbarsEnabled(true);
 
-    OwnPtr<WebKit::WebScrollbar> scrollbar = WebKit::WebScrollbar::create(mockScrollbar.get());
+    OwnPtr<WebKit::WebScrollbar> scrollbar = adoptPtr(new WebKit::WebScrollbarImpl(mockScrollbar.get()));
     RefPtr<LayerChromium> layerTreeRoot = LayerChromium::create();
     RefPtr<LayerChromium> contentLayer = LayerChromium::create();
     RefPtr<LayerChromium> scrollbarLayer = ScrollbarLayerChromium::create(scrollbar.release(), painter, WebKit::FakeWebScrollbarThemeGeometry::create(), layerTreeRoot->id());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to