| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 return new SolidBackground(color); | 72 return new SolidBackground(color); |
| 73 } | 73 } |
| 74 | 74 |
| 75 // static | 75 // static |
| 76 Background* Background::CreateStandardPanelBackground() { | 76 Background* Background::CreateStandardPanelBackground() { |
| 77 // TODO(beng): Should be in NativeTheme. | 77 // TODO(beng): Should be in NativeTheme. |
| 78 return CreateSolidBackground(SK_ColorWHITE); | 78 return CreateSolidBackground(SK_ColorWHITE); |
| 79 } | 79 } |
| 80 | 80 |
| 81 // static | 81 // static |
| 82 Background* Background::CreateVerticalGradientBackground(SkColor color1, | |
| 83 SkColor color2) { | |
| 84 Background* background = | |
| 85 CreateBackgroundPainter(Painter::CreateVerticalGradient(color1, color2)); | |
| 86 background->SetNativeControlColor( | |
| 87 color_utils::AlphaBlend(color1, color2, 128)); | |
| 88 | |
| 89 return background; | |
| 90 } | |
| 91 | |
| 92 // static | |
| 93 Background* Background::CreateBackgroundPainter( | 82 Background* Background::CreateBackgroundPainter( |
| 94 std::unique_ptr<Painter> painter) { | 83 std::unique_ptr<Painter> painter) { |
| 95 return new BackgroundPainter(std::move(painter)); | 84 return new BackgroundPainter(std::move(painter)); |
| 96 } | 85 } |
| 97 | 86 |
| 98 } // namespace views | 87 } // namespace views |
| OLD | NEW |