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

Unified Diff: webkit/compositor_bindings/web_to_ccscrollbar_theme_painter_adapter.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
Index: webkit/compositor_bindings/web_to_ccscrollbar_theme_painter_adapter.h
diff --git a/webkit/compositor_bindings/web_to_ccscrollbar_theme_painter_adapter.h b/webkit/compositor_bindings/web_to_ccscrollbar_theme_painter_adapter.h
new file mode 100644
index 0000000000000000000000000000000000000000..7ad80bc02f60767947d01d358767cca668099aa1
--- /dev/null
+++ b/webkit/compositor_bindings/web_to_ccscrollbar_theme_painter_adapter.h
@@ -0,0 +1,55 @@
+// 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 WEBKIT_COMPOSITOR_BINDINGS_WEB_TO_CCSCROLLBAR_THEME_PAINTER_ADAPTER_H_
+#define WEBKIT_COMPOSITOR_BINDINGS_WEB_TO_CCSCROLLBAR_THEME_PAINTER_ADAPTER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "cc/scrollbar_theme_painter.h"
+
+namespace WebKit {
+
+class WebScrollbarThemePainter;
+
+class WebToCCScrollbarThemePainterAdapter : public cc::ScrollbarThemePainter {
+ public:
+ static scoped_ptr<WebToCCScrollbarThemePainterAdapter> Create(
+ scoped_ptr<WebScrollbarThemePainter> webPainter) {
+ return make_scoped_ptr(new WebToCCScrollbarThemePainterAdapter(
+ webPainter.Pass()));
+ }
+ virtual ~WebToCCScrollbarThemePainterAdapter();
+
+ 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;
+
+ private:
+ WebToCCScrollbarThemePainterAdapter(
+ scoped_ptr<WebScrollbarThemePainter> webPainter)
+ : painter_(webPainter.Pass()) {}
+
+ scoped_ptr<WebScrollbarThemePainter> painter_;
+};
+
+} // namespace WebKit
+
+#endif // WEBKIT_COMPOSITOR_BINDINGS_WEB_TO_CCSCROLLBAR_THEME_PAINTER_ADAPTER_H_

Powered by Google App Engine
This is Rietveld 408576698