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_BACKGROUND_H_ | 5 #ifndef UI_VIEWS_BACKGROUND_H_ |
6 #define UI_VIEWS_BACKGROUND_H_ | 6 #define UI_VIEWS_BACKGROUND_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
15 #include "ui/native_theme/native_theme.h" | |
16 #include "ui/views/views_export.h" | 15 #include "ui/views/views_export.h" |
17 | 16 |
18 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
19 #include <windows.h> | 18 #include <windows.h> |
20 #endif // defined(OS_WIN) | 19 #endif // defined(OS_WIN) |
21 | 20 |
22 namespace gfx { | 21 namespace gfx { |
23 class Canvas; | 22 class Canvas; |
24 } | 23 } |
25 | 24 |
(...skipping 15 matching lines...) Expand all Loading... |
41 // | 40 // |
42 ///////////////////////////////////////////////////////////////////////////// | 41 ///////////////////////////////////////////////////////////////////////////// |
43 class VIEWS_EXPORT Background { | 42 class VIEWS_EXPORT Background { |
44 public: | 43 public: |
45 Background(); | 44 Background(); |
46 virtual ~Background(); | 45 virtual ~Background(); |
47 | 46 |
48 // Creates a background that fills the canvas in the specified color. | 47 // Creates a background that fills the canvas in the specified color. |
49 static Background* CreateSolidBackground(SkColor color); | 48 static Background* CreateSolidBackground(SkColor color); |
50 | 49 |
51 // Creates a background that fills the canvas in the color specified by the | |
52 // view's NativeTheme and the given color identifier. | |
53 static Background* CreateThemedSolidBackground( | |
54 View* view, | |
55 ui::NativeTheme::ColorId color_id); | |
56 | |
57 // Creates a background that fills the canvas in the specified color. | 50 // Creates a background that fills the canvas in the specified color. |
58 static Background* CreateSolidBackground(int r, int g, int b) { | 51 static Background* CreateSolidBackground(int r, int g, int b) { |
59 return CreateSolidBackground(SkColorSetRGB(r, g, b)); | 52 return CreateSolidBackground(SkColorSetRGB(r, g, b)); |
60 } | 53 } |
61 | 54 |
62 // Creates a background that fills the canvas in the specified color. | 55 // Creates a background that fills the canvas in the specified color. |
63 static Background* CreateSolidBackground(int r, int g, int b, int a) { | 56 static Background* CreateSolidBackground(int r, int g, int b, int a) { |
64 return CreateSolidBackground(SkColorSetARGB(a, r, g, b)); | 57 return CreateSolidBackground(SkColorSetARGB(a, r, g, b)); |
65 } | 58 } |
66 | 59 |
(...skipping 18 matching lines...) Expand all Loading... |
85 | 78 |
86 private: | 79 private: |
87 SkColor color_; | 80 SkColor color_; |
88 | 81 |
89 DISALLOW_COPY_AND_ASSIGN(Background); | 82 DISALLOW_COPY_AND_ASSIGN(Background); |
90 }; | 83 }; |
91 | 84 |
92 } // namespace views | 85 } // namespace views |
93 | 86 |
94 #endif // UI_VIEWS_BACKGROUND_H_ | 87 #endif // UI_VIEWS_BACKGROUND_H_ |
OLD | NEW |