summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_scrollbar.h
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-22 17:36:49 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-22 17:36:49 +0000
commitc28df4c12c5acfca195bd473ed11a2003634846e (patch)
treeaa4f4a8aa86e6fab0331e65c833f80e6ec307f07 /cc/test/fake_scrollbar.h
parent6c7a0fdd05370cd3899cffdc6170f9b0df8856a0 (diff)
downloadchromium_src-c28df4c12c5acfca195bd473ed11a2003634846e.zip
chromium_src-c28df4c12c5acfca195bd473ed11a2003634846e.tar.gz
chromium_src-c28df4c12c5acfca195bd473ed11a2003634846e.tar.bz2
Remove cc/ dependency on WebKit::WebScrollbar*
This removes the compositor implementation's dependency on the WebKit scrollbar family of classes. The compositor supports two types of scrollbars - those that have arbitrarily painted content, used on most platforms, and solid color simple scrollbars used on mobile platforms and for pinch. The former grab their geometry and paint info on the main thread during the update via the cc::Scrollbar interface, which for the WebKit embedding is implemented by webkit/renderer/compositor_bindings/scrollbar_impl which uses the WebKit WebScrollbar/WebScrollbarThemeGeometry/WebScrollbarThemePainter interfaces to handles the complex positioning and part painting logic. The only mutation we support on the compositor thread for these scrollbars is moving the thumb, which is done in cc::ScrollbarLayerImpl::AppendQuads. The latter simply have everything computed directly by cc::ScrollbarLayer(Impl). BUG=can't find it R=enne@chromium.org Review URL: https://codereview.chromium.org/15349002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_scrollbar.h')
-rw-r--r--cc/test/fake_scrollbar.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/cc/test/fake_scrollbar.h b/cc/test/fake_scrollbar.h
new file mode 100644
index 0000000..b9ac409
--- /dev/null
+++ b/cc/test/fake_scrollbar.h
@@ -0,0 +1,46 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_TEST_FAKE_SCROLLBAR_H_
+#define CC_TEST_FAKE_SCROLLBAR_H_
+
+#include "base/compiler_specific.h"
+#include "cc/input/scrollbar.h"
+#include "third_party/skia/include/core/SkColor.h"
+
+namespace cc {
+
+class FakeScrollbar : public Scrollbar {
+ public:
+ FakeScrollbar();
+ FakeScrollbar(bool paint, bool has_thumb, bool is_overlay);
+ virtual ~FakeScrollbar();
+
+ // Scrollbar implementation.
+ virtual ScrollbarOrientation Orientation() const OVERRIDE;
+ virtual gfx::Point Location() const OVERRIDE;
+ virtual bool IsOverlay() const OVERRIDE;
+ virtual bool HasThumb() const OVERRIDE;
+ virtual int ThumbThickness() const OVERRIDE;
+ virtual int ThumbLength() const OVERRIDE;
+ virtual gfx::Rect TrackRect() const OVERRIDE;
+ virtual void PaintPart(SkCanvas* canvas,
+ ScrollbarPart part,
+ gfx::Rect content_rect) OVERRIDE;
+
+ void set_location(gfx::Point location) { location_ = location; }
+
+ private:
+ bool paint_;
+ bool has_thumb_;
+ bool is_overlay_;
+ gfx::Point location_;
+ SkColor fill_color_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeScrollbar);
+};
+
+} // namespace cc
+
+#endif // CC_TEST_FAKE_SCROLLBAR_H_