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

Side by Side Diff: ui/views/style/platform_style_mac.mm

Issue 2382443007: Clean up NativeTheme (particularly CommonTheme). (Closed)
Patch Set: two slight fixes Created 4 years, 2 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/style/platform_style.h" 5 #include "ui/views/style/platform_style.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/gfx/color_utils.h" 9 #include "ui/gfx/color_utils.h"
10 #include "ui/gfx/paint_vector_icon.h" 10 #include "ui/gfx/paint_vector_icon.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 Button::ButtonState state = button.state(); 70 Button::ButtonState state = button.state();
71 if (button.style() == Button::STYLE_BUTTON && button.is_default()) { 71 if (button.style() == Button::STYLE_BUTTON && button.is_default()) {
72 // For convenience, we currently assume Mac wants the color corresponding to 72 // For convenience, we currently assume Mac wants the color corresponding to
73 // the pressed state for default buttons. 73 // the pressed state for default buttons.
74 state = Button::STATE_PRESSED; 74 state = Button::STATE_PRESSED;
75 } 75 }
76 return color_by_state[state]; 76 return color_by_state[state];
77 } 77 }
78 78
79 // static 79 // static
80 void PlatformStyle::ApplyLabelButtonTextStyle( 80 void PlatformStyle::ApplyLabelButtonTextStyle(
Evan Stade 2016/09/30 18:02:36 this won't be necessary any more when harmony is d
tdanderson 2016/09/30 21:00:56 Is this something that will be obvious / you will
Evan Stade 2016/09/30 22:19:00 should be obvious in the sense that it won't be ca
81 views::Label* label, 81 views::Label* label,
82 ButtonColorByState* color_by_state) { 82 ButtonColorByState* color_by_state) {
83 const ui::NativeTheme* theme = label->GetNativeTheme();
84 ButtonColorByState& colors = *color_by_state; 83 ButtonColorByState& colors = *color_by_state;
85 colors[Button::STATE_PRESSED] = 84 colors[Button::STATE_PRESSED] = SK_ColorWHITE;
86 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHighlightColor);
87 } 85 }
88 86
89 // static 87 // static
90 void PlatformStyle::OnTextfieldKeypressUnhandled() { 88 void PlatformStyle::OnTextfieldKeypressUnhandled() {
91 NSBeep(); 89 NSBeep();
92 } 90 }
93 91
94 } // namespace views 92 } // namespace views
OLDNEW
« ui/views/style/platform_style.cc ('K') | « ui/views/style/platform_style.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698