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

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: 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..773f68d9bfaba7cf707d5fba01b0a24fae5aac15
--- /dev/null
+++ b/webkit/compositor_bindings/web_to_ccscrollbar_theme_painter_adapter.h
@@ -0,0 +1,52 @@
+// 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"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbarThemePainter.h"
enne (OOO) 2012/12/17 20:48:55 Is it possible to not pollute the header with this
danakj 2012/12/17 21:45:09 Done.
+
+namespace WebKit {
+
+class WebToCCScrollbarThemePainterAdapter : public cc::ScrollbarThemePainter {
+ public:
+ static scoped_ptr<WebToCCScrollbarThemePainterAdapter> Create(
+ const WebScrollbarThemePainter& webPainter) {
+ return make_scoped_ptr(new WebToCCScrollbarThemePainterAdapter(webPainter));
+ }
+
+ 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(
+ const WebScrollbarThemePainter& webPainter)
+ : m_painter(webPainter) {}
+
+ WebScrollbarThemePainter m_painter;
+};
+
+} // namespace WebKit
+
+#endif // WEBKIT_COMPOSITOR_BINDINGS_WEB_TO_CCSCROLLBAR_THEME_PAINTER_ADAPTER_H_

Powered by Google App Engine
This is Rietveld 408576698