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_PAINTER_H_ | 5 #ifndef UI_VIEWS_PAINTER_H_ |
6 #define UI_VIEWS_PAINTER_H_ | 6 #define UI_VIEWS_PAINTER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // region. The center is tiled in the remaining space. All images must have the | 93 // region. The center is tiled in the remaining space. All images must have the |
94 // same height. | 94 // same height. |
95 class VIEWS_EXPORT HorizontalPainter : public Painter { | 95 class VIEWS_EXPORT HorizontalPainter : public Painter { |
96 public: | 96 public: |
97 // Constructs a new HorizontalPainter loading the specified image names. | 97 // Constructs a new HorizontalPainter loading the specified image names. |
98 // The images must be in the order left, right and center. | 98 // The images must be in the order left, right and center. |
99 explicit HorizontalPainter(const int image_resource_names[]); | 99 explicit HorizontalPainter(const int image_resource_names[]); |
100 virtual ~HorizontalPainter(); | 100 virtual ~HorizontalPainter(); |
101 | 101 |
102 // Painter: | 102 // Painter: |
103 virtual gfx::Size GetMinimumSize() const OVERRIDE; | 103 virtual gfx::Size GetMinimumSize() const override; |
104 virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE; | 104 virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) override; |
105 | 105 |
106 private: | 106 private: |
107 // The image chunks. | 107 // The image chunks. |
108 enum BorderElements { | 108 enum BorderElements { |
109 LEFT, | 109 LEFT, |
110 CENTER, | 110 CENTER, |
111 RIGHT | 111 RIGHT |
112 }; | 112 }; |
113 | 113 |
114 // NOTE: the images are owned by ResourceBundle. Don't free them. | 114 // NOTE: the images are owned by ResourceBundle. Don't free them. |
115 const gfx::ImageSkia* images_[3]; | 115 const gfx::ImageSkia* images_[3]; |
116 | 116 |
117 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); | 117 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); |
118 }; | 118 }; |
119 | 119 |
120 } // namespace views | 120 } // namespace views |
121 | 121 |
122 #endif // UI_VIEWS_PAINTER_H_ | 122 #endif // UI_VIEWS_PAINTER_H_ |
OLD | NEW |