Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: ui/views/background.cc

Issue 2616273002: Native Themes: Add table header colors (Closed)
Patch Set: Add gradients back Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/background.h ('k') | ui/views/controls/table/table_header.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/views/background.h ('k') | ui/views/controls/table/table_header.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698