| 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 { | 17 namespace ui { |
| 18 class Animation; | 18 class Animation; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace views { | 21 namespace views { |
| 22 | 22 |
| 23 class NativeThemeDelegate; | 23 class NativeThemeDelegate; |
| 24 | 24 |
| 25 // A Painter that uses NativeTheme to implement painting and sizing. A | 25 // A Painter that uses NativeTheme to implement painting and sizing. A |
| 26 // theme delegate must be given at construction time so that the appropriate | 26 // theme delegate must be given at construction time so that the appropriate |
| 27 // painting and sizing can be done. | 27 // painting and sizing can be done. |
| 28 class VIEWS_API NativeThemePainter : public Painter { | 28 class VIEWS_EXPORT NativeThemePainter : public Painter { |
| 29 public: | 29 public: |
| 30 explicit NativeThemePainter(NativeThemeDelegate* delegate); | 30 explicit NativeThemePainter(NativeThemeDelegate* delegate); |
| 31 | 31 |
| 32 virtual ~NativeThemePainter() {} | 32 virtual ~NativeThemePainter() {} |
| 33 | 33 |
| 34 // Returns the preferred size of the native part being painted. | 34 // Returns the preferred size of the native part being painted. |
| 35 gfx::Size GetPreferredSize(); | 35 gfx::Size GetPreferredSize(); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 // The delegate the controls the appearance of this painter. | 38 // The delegate the controls the appearance of this painter. |
| 39 NativeThemeDelegate* delegate_; | 39 NativeThemeDelegate* delegate_; |
| 40 | 40 |
| 41 // Overridden from Painter: | 41 // Overridden from Painter: |
| 42 virtual void Paint(int w, int h, gfx::Canvas* canvas) OVERRIDE; | 42 virtual void Paint(int w, int h, gfx::Canvas* canvas) OVERRIDE; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(NativeThemePainter); | 44 DISALLOW_COPY_AND_ASSIGN(NativeThemePainter); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace views | 47 } // namespace views |
| 48 | 48 |
| 49 #endif // VIEWS_NATIVE_THEME_PAINTER_H_ | 49 #endif // VIEWS_NATIVE_THEME_PAINTER_H_ |
| OLD | NEW |