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 #include "ui/views/background.h" | 5 #include "ui/views/background.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "skia/ext/skia_utils_win.h" | 8 #include "skia/ext/skia_utils_win.h" |
9 #include "third_party/skia/include/core/SkPaint.h" | 9 #include "third_party/skia/include/core/SkPaint.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 #endif | 87 #endif |
88 | 88 |
89 //static | 89 //static |
90 Background* Background::CreateSolidBackground(SkColor color) { | 90 Background* Background::CreateSolidBackground(SkColor color) { |
91 return new SolidBackground(color); | 91 return new SolidBackground(color); |
92 } | 92 } |
93 | 93 |
94 //static | 94 //static |
95 Background* Background::CreateStandardPanelBackground() { | 95 Background* Background::CreateStandardPanelBackground() { |
96 // TODO(beng): Should be in NativeTheme. | 96 // TODO(beng): Should be in NativeTheme. |
97 #if defined(USE_AURA) | |
98 return CreateSolidBackground(SK_ColorWHITE); | 97 return CreateSolidBackground(SK_ColorWHITE); |
99 #else | |
100 return CreateVerticalGradientBackground(SkColorSetRGB(246, 250, 255), | |
101 SkColorSetRGB(219, 235, 255)); | |
102 #endif | |
103 } | 98 } |
104 | 99 |
105 //static | 100 //static |
106 Background* Background::CreateVerticalGradientBackground(SkColor color1, | 101 Background* Background::CreateVerticalGradientBackground(SkColor color1, |
107 SkColor color2) { | 102 SkColor color2) { |
108 Background* background = CreateBackgroundPainter( | 103 Background* background = CreateBackgroundPainter( |
109 true, Painter::CreateVerticalGradient(color1, color2)); | 104 true, Painter::CreateVerticalGradient(color1, color2)); |
110 background->SetNativeControlColor( | 105 background->SetNativeControlColor( |
111 color_utils::AlphaBlend(color1, color2, 128)); | 106 color_utils::AlphaBlend(color1, color2, 128)); |
112 | 107 |
(...skipping 13 matching lines...) Expand all Loading... |
126 return background; | 121 return background; |
127 } | 122 } |
128 | 123 |
129 //static | 124 //static |
130 Background* Background::CreateBackgroundPainter(bool owns_painter, | 125 Background* Background::CreateBackgroundPainter(bool owns_painter, |
131 Painter* painter) { | 126 Painter* painter) { |
132 return new BackgroundPainter(owns_painter, painter); | 127 return new BackgroundPainter(owns_painter, painter); |
133 } | 128 } |
134 | 129 |
135 } // namespace views | 130 } // namespace views |
OLD | NEW |