| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef VIEWS_NATIVE_THEME_PAINTER_H_ | |
| 6 #define VIEWS_NATIVE_THEME_PAINTER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "views/painter.h" | |
| 11 | |
| 12 namespace gfx { | |
| 13 class Canvas; | |
| 14 class Size; | |
| 15 } | |
| 16 | |
| 17 namespace views { | |
| 18 | |
| 19 class NativeThemeDelegate; | |
| 20 | |
| 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 | |
| 23 // painting and sizing can be done. | |
| 24 class VIEWS_EXPORT NativeThemePainter : public Painter { | |
| 25 public: | |
| 26 explicit NativeThemePainter(NativeThemeDelegate* delegate); | |
| 27 | |
| 28 virtual ~NativeThemePainter() {} | |
| 29 | |
| 30 // Returns the preferred size of the native part being painted. | |
| 31 gfx::Size GetPreferredSize(); | |
| 32 | |
| 33 private: | |
| 34 // The delegate the controls the appearance of this painter. | |
| 35 NativeThemeDelegate* delegate_; | |
| 36 | |
| 37 // Overridden from Painter: | |
| 38 virtual void Paint(int w, int h, gfx::Canvas* canvas) OVERRIDE; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(NativeThemePainter); | |
| 41 }; | |
| 42 | |
| 43 } // namespace views | |
| 44 | |
| 45 #endif // VIEWS_NATIVE_THEME_PAINTER_H_ | |
| OLD | NEW |