| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_NATIVE_THEME_PAINTER_H_ | 5 #ifndef VIEWS_NATIVE_THEME_PAINTER_H_ |
| 6 #define VIEWS_NATIVE_THEME_PAINTER_H_ | 6 #define 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 "views/painter.h" | 10 #include "views/painter.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Canvas; | 13 class Canvas; |
| 14 class Size; | 14 class Size; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace ui { | |
| 18 class Animation; | |
| 19 } | |
| 20 | |
| 21 namespace views { | 17 namespace views { |
| 22 | 18 |
| 23 class NativeThemeDelegate; | 19 class NativeThemeDelegate; |
| 24 | 20 |
| 25 // A Painter that uses NativeTheme to implement painting and sizing. A | 21 // A Painter that uses NativeTheme to implement painting and sizing. A |
| 26 // 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 |
| 27 // painting and sizing can be done. | 23 // painting and sizing can be done. |
| 28 class VIEWS_EXPORT NativeThemePainter : public Painter { | 24 class VIEWS_EXPORT NativeThemePainter : public Painter { |
| 29 public: | 25 public: |
| 30 explicit NativeThemePainter(NativeThemeDelegate* delegate); | 26 explicit NativeThemePainter(NativeThemeDelegate* delegate); |
| 31 | 27 |
| 32 virtual ~NativeThemePainter() {} | 28 virtual ~NativeThemePainter() {} |
| 33 | 29 |
| 34 // Returns the preferred size of the native part being painted. | 30 // Returns the preferred size of the native part being painted. |
| 35 gfx::Size GetPreferredSize(); | 31 gfx::Size GetPreferredSize(); |
| 36 | 32 |
| 37 private: | 33 private: |
| 38 // The delegate the controls the appearance of this painter. | 34 // The delegate the controls the appearance of this painter. |
| 39 NativeThemeDelegate* delegate_; | 35 NativeThemeDelegate* delegate_; |
| 40 | 36 |
| 41 // Overridden from Painter: | 37 // Overridden from Painter: |
| 42 virtual void Paint(int w, int h, gfx::Canvas* canvas) OVERRIDE; | 38 virtual void Paint(int w, int h, gfx::Canvas* canvas) OVERRIDE; |
| 43 | 39 |
| 44 DISALLOW_COPY_AND_ASSIGN(NativeThemePainter); | 40 DISALLOW_COPY_AND_ASSIGN(NativeThemePainter); |
| 45 }; | 41 }; |
| 46 | 42 |
| 47 } // namespace views | 43 } // namespace views |
| 48 | 44 |
| 49 #endif // VIEWS_NATIVE_THEME_PAINTER_H_ | 45 #endif // VIEWS_NATIVE_THEME_PAINTER_H_ |
| OLD | NEW |