| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_VIEWS_NATIVE_THEME_PAINTER_H_ | 5 #ifndef UI_VIEWS_NATIVE_THEME_PAINTER_H_ |
| 6 #define UI_VIEWS_NATIVE_THEME_PAINTER_H_ | 6 #define UI_VIEWS_NATIVE_THEME_PAINTER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/views/painter.h" | 10 #include "ui/views/painter.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Canvas; | 13 class CanvasSkia; |
| 14 class Size; | 14 class Size; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace views { | 17 namespace views { |
| 18 | 18 |
| 19 class NativeThemeDelegate; | 19 class NativeThemeDelegate; |
| 20 | 20 |
| 21 // A Painter that uses NativeTheme to implement painting and sizing. A | 21 // A Painter that uses NativeTheme to implement painting and sizing. A |
| 22 // theme delegate must be given at construction time so that the appropriate | 22 // theme delegate must be given at construction time so that the appropriate |
| 23 // painting and sizing can be done. | 23 // painting and sizing can be done. |
| 24 class VIEWS_EXPORT NativeThemePainter : public Painter { | 24 class VIEWS_EXPORT NativeThemePainter : public Painter { |
| 25 public: | 25 public: |
| 26 explicit NativeThemePainter(NativeThemeDelegate* delegate); | 26 explicit NativeThemePainter(NativeThemeDelegate* delegate); |
| 27 | 27 |
| 28 virtual ~NativeThemePainter() {} | 28 virtual ~NativeThemePainter() {} |
| 29 | 29 |
| 30 // Returns the preferred size of the native part being painted. | 30 // Returns the preferred size of the native part being painted. |
| 31 gfx::Size GetPreferredSize(); | 31 gfx::Size GetPreferredSize(); |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 // The delegate the controls the appearance of this painter. | 34 // The delegate the controls the appearance of this painter. |
| 35 NativeThemeDelegate* delegate_; | 35 NativeThemeDelegate* delegate_; |
| 36 | 36 |
| 37 // Overridden from Painter: | 37 // Overridden from Painter: |
| 38 virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE; | 38 virtual void Paint(gfx::CanvasSkia* canvas, const gfx::Size& size) OVERRIDE; |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(NativeThemePainter); | 40 DISALLOW_COPY_AND_ASSIGN(NativeThemePainter); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace views | 43 } // namespace views |
| 44 | 44 |
| 45 #endif // UI_VIEWS_NATIVE_THEME_PAINTER_H_ | 45 #endif // UI_VIEWS_NATIVE_THEME_PAINTER_H_ |
| OLD | NEW |