| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BACKGROUND_H_ | 5 #ifndef VIEWS_BACKGROUND_H_ |
| 6 #define VIEWS_BACKGROUND_H_ | 6 #define VIEWS_BACKGROUND_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 #endif // defined(OS_WIN) | 12 #endif // defined(OS_WIN) |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
| 16 | 16 |
| 17 class ChromeCanvas; | 17 namespace gfx { |
| 18 class Canvas; |
| 19 } |
| 18 | 20 |
| 19 namespace views { | 21 namespace views { |
| 20 | 22 |
| 21 class Painter; | 23 class Painter; |
| 22 class View; | 24 class View; |
| 23 | 25 |
| 24 ///////////////////////////////////////////////////////////////////////////// | 26 ///////////////////////////////////////////////////////////////////////////// |
| 25 // | 27 // |
| 26 // Background class | 28 // Background class |
| 27 // | 29 // |
| (...skipping 30 matching lines...) Expand all Loading... |
| 58 | 60 |
| 59 // Creates Chrome's standard panel background | 61 // Creates Chrome's standard panel background |
| 60 static Background* CreateStandardPanelBackground(); | 62 static Background* CreateStandardPanelBackground(); |
| 61 | 63 |
| 62 // Creates a Background from the specified Painter. If owns_painter is | 64 // Creates a Background from the specified Painter. If owns_painter is |
| 63 // true, the Painter is deleted when the Border is deleted. | 65 // true, the Painter is deleted when the Border is deleted. |
| 64 static Background* CreateBackgroundPainter(bool owns_painter, | 66 static Background* CreateBackgroundPainter(bool owns_painter, |
| 65 Painter* painter); | 67 Painter* painter); |
| 66 | 68 |
| 67 // Render the background for the provided view | 69 // Render the background for the provided view |
| 68 virtual void Paint(ChromeCanvas* canvas, View* view) const = 0; | 70 virtual void Paint(gfx::Canvas* canvas, View* view) const = 0; |
| 69 | 71 |
| 70 // Set a solid, opaque color to be used when drawing backgrounds of native | 72 // Set a solid, opaque color to be used when drawing backgrounds of native |
| 71 // controls. Unfortunately alpha=0 is not an option. | 73 // controls. Unfortunately alpha=0 is not an option. |
| 72 void SetNativeControlColor(SkColor color); | 74 void SetNativeControlColor(SkColor color); |
| 73 | 75 |
| 74 #if defined(OS_WIN) | 76 #if defined(OS_WIN) |
| 75 // TODO(port): Make GetNativeControlBrush portable (currently uses HBRUSH). | 77 // TODO(port): Make GetNativeControlBrush portable (currently uses HBRUSH). |
| 76 | 78 |
| 77 // Get the brush that was specified by SetNativeControlColor | 79 // Get the brush that was specified by SetNativeControlColor |
| 78 HBRUSH GetNativeControlBrush() const { return native_control_brush_; }; | 80 HBRUSH GetNativeControlBrush() const { return native_control_brush_; }; |
| 79 #endif // defined(OS_WIN) | 81 #endif // defined(OS_WIN) |
| 80 | 82 |
| 81 private: | 83 private: |
| 82 #if defined(OS_WIN) | 84 #if defined(OS_WIN) |
| 83 // TODO(port): Create portable replacement for HBRUSH. | 85 // TODO(port): Create portable replacement for HBRUSH. |
| 84 HBRUSH native_control_brush_; | 86 HBRUSH native_control_brush_; |
| 85 #endif // defined(OS_WIN) | 87 #endif // defined(OS_WIN) |
| 86 DISALLOW_COPY_AND_ASSIGN(Background); | 88 DISALLOW_COPY_AND_ASSIGN(Background); |
| 87 }; | 89 }; |
| 88 | 90 |
| 89 } // namespace views | 91 } // namespace views |
| 90 | 92 |
| 91 #endif // VIEWS_BACKGROUND_H_ | 93 #endif // VIEWS_BACKGROUND_H_ |
| OLD | NEW |