Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5200)

Unified Diff: cc/test/fake_scrollbar_theme_painter.h

Issue 11609002: cc: Create a cc::ScrollbarThemePainter and an adapter class in compositor bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: notry Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scrollbar_theme_painter.h ('k') | cc/test/fake_scrollbar_theme_painter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_scrollbar_theme_painter.h
diff --git a/cc/test/fake_scrollbar_theme_painter.h b/cc/test/fake_scrollbar_theme_painter.h
new file mode 100644
index 0000000000000000000000000000000000000000..61c8dd38a950649c31a9b1465be867ca918b860b
--- /dev/null
+++ b/cc/test/fake_scrollbar_theme_painter.h
@@ -0,0 +1,59 @@
+// 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_THEME_PAINTER_H_
+#define CC_TEST_FAKE_SCROLLBAR_THEME_PAINTER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "cc/scrollbar_theme_painter.h"
+#include "third_party/skia/include/core/SkColor.h"
+
+namespace cc {
+
+class FakeScrollbarThemePainter : public ScrollbarThemePainter {
+ public:
+ static scoped_ptr<FakeScrollbarThemePainter> Create(bool paint) {
+ return make_scoped_ptr(new FakeScrollbarThemePainter(paint));
+ }
+ virtual ~FakeScrollbarThemePainter() {}
+
+ virtual void PaintScrollbarBackground(SkCanvas* canvas, const gfx::Rect& rect)
+ OVERRIDE;
+ virtual void PaintTrackBackground(SkCanvas* canvas, const gfx::Rect& rect)
+ OVERRIDE;
+ virtual void PaintBackTrackPart(SkCanvas* canvas, const gfx::Rect& rect)
+ OVERRIDE;
+ virtual void PaintForwardTrackPart(SkCanvas* canvas, const gfx::Rect& rect)
+ OVERRIDE;
+ virtual void PaintBackButtonStart(SkCanvas* canvas, const gfx::Rect& rect)
+ OVERRIDE;
+ virtual void PaintBackButtonEnd(SkCanvas* canvas, const gfx::Rect& rect)
+ OVERRIDE;
+ virtual void PaintForwardButtonStart(SkCanvas* canvas, const gfx::Rect& rect)
+ OVERRIDE;
+ virtual void PaintForwardButtonEnd(SkCanvas* canvas, const gfx::Rect& rect)
+ OVERRIDE;
+ virtual void PaintTickmarks(SkCanvas* canvas, const gfx::Rect& rect)
+ OVERRIDE;
+ virtual void PaintThumb(SkCanvas* canvas, const gfx::Rect& rect)
+ OVERRIDE;
+
+ void set_paint(bool paint) { paint_ = paint; }
+
+ private:
+ explicit FakeScrollbarThemePainter(bool paint)
+ : paint_(paint),
+ fill_color_(0) {}
+
+ void Paint(SkCanvas* canvas, gfx::Rect rect);
+
+ bool paint_;
+ SkColor fill_color_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeScrollbarThemePainter);
+};
+
+} // namespace cc
+
+#endif // CC_TEST_FAKE_SCROLLBAR_BACKGROUND_PAINTER_H_
« no previous file with comments | « cc/scrollbar_theme_painter.h ('k') | cc/test/fake_scrollbar_theme_painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698