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

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

Issue 1971333002: Views: factor out Combobox background and const-ify style (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ios build break Created 4 years, 7 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/style/platform_style.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/paint_vector_icon.h" 9 #include "ui/gfx/paint_vector_icon.h"
10 #include "ui/gfx/vector_icons.h" 10 #include "ui/gfx/vector_icons.h"
(...skipping 26 matching lines...) Expand all
37 kComboboxArrowWidth, 37 kComboboxArrowWidth,
38 is_enabled ? SK_ColorWHITE : SK_ColorBLACK); 38 is_enabled ? SK_ColorWHITE : SK_ColorBLACK);
39 } 39 }
40 40
41 // static 41 // static
42 std::unique_ptr<FocusableBorder> PlatformStyle::CreateComboboxBorder() { 42 std::unique_ptr<FocusableBorder> PlatformStyle::CreateComboboxBorder() {
43 return base::WrapUnique(new FocusableRoundedBorder); 43 return base::WrapUnique(new FocusableRoundedBorder);
44 } 44 }
45 45
46 // static 46 // static
47 std::unique_ptr<Background> PlatformStyle::CreateComboboxBackground() { 47 std::unique_ptr<Background> PlatformStyle::CreateComboboxBackground(
48 return base::WrapUnique(new ComboboxBackgroundMac); 48 int shoulder_width) {
49 return base::WrapUnique(new ComboboxBackgroundMac(shoulder_width));
49 } 50 }
50 51
51 // static 52 // static
52 std::unique_ptr<LabelButtonBorder> PlatformStyle::CreateLabelButtonBorder( 53 std::unique_ptr<LabelButtonBorder> PlatformStyle::CreateLabelButtonBorder(
53 Button::ButtonStyle style) { 54 Button::ButtonStyle style) {
54 if (style == Button::STYLE_BUTTON) 55 if (style == Button::STYLE_BUTTON)
55 return base::WrapUnique(new DialogButtonBorderMac()); 56 return base::WrapUnique(new DialogButtonBorderMac());
56 57
57 return base::WrapUnique(new LabelButtonAssetBorder(style)); 58 return base::WrapUnique(new LabelButtonAssetBorder(style));
58 } 59 }
(...skipping 21 matching lines...) Expand all
80 void PlatformStyle::ApplyLabelButtonTextStyle( 81 void PlatformStyle::ApplyLabelButtonTextStyle(
81 views::Label* label, 82 views::Label* label,
82 ButtonColorByState* color_by_state) { 83 ButtonColorByState* color_by_state) {
83 const ui::NativeTheme* theme = label->GetNativeTheme(); 84 const ui::NativeTheme* theme = label->GetNativeTheme();
84 ButtonColorByState& colors = *color_by_state; 85 ButtonColorByState& colors = *color_by_state;
85 colors[Button::STATE_PRESSED] = 86 colors[Button::STATE_PRESSED] =
86 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHighlightColor); 87 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHighlightColor);
87 } 88 }
88 89
89 } // namespace views 90 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/style/platform_style.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698