| OLD | NEW |
| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 return base::WrapUnique(new FocusableRoundedBorder); | 54 return base::WrapUnique(new FocusableRoundedBorder); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // static | 57 // static |
| 58 std::unique_ptr<Background> PlatformStyle::CreateComboboxBackground( | 58 std::unique_ptr<Background> PlatformStyle::CreateComboboxBackground( |
| 59 int shoulder_width) { | 59 int shoulder_width) { |
| 60 return base::MakeUnique<ComboboxBackgroundMac>(shoulder_width); | 60 return base::MakeUnique<ComboboxBackgroundMac>(shoulder_width); |
| 61 } | 61 } |
| 62 | 62 |
| 63 // static | 63 // static |
| 64 std::unique_ptr<LabelButtonBorder> PlatformStyle::CreateLabelButtonBorder( | |
| 65 Button::ButtonStyle style) { | |
| 66 if (style == Button::STYLE_BUTTON) | |
| 67 return base::MakeUnique<DialogButtonBorderMac>(); | |
| 68 | |
| 69 return base::MakeUnique<LabelButtonAssetBorder>(style); | |
| 70 } | |
| 71 | |
| 72 // static | |
| 73 std::unique_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { | 64 std::unique_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { |
| 74 return base::MakeUnique<CocoaScrollBar>(is_horizontal); | 65 return base::MakeUnique<CocoaScrollBar>(is_horizontal); |
| 75 } | 66 } |
| 76 | 67 |
| 77 // static | 68 // static |
| 78 SkColor PlatformStyle::TextColorForButton( | 69 SkColor PlatformStyle::TextColorForButton( |
| 79 const ButtonColorByState& color_by_state, | 70 const ButtonColorByState& color_by_state, |
| 80 const LabelButton& button) { | 71 const LabelButton& button) { |
| 81 Button::ButtonState state = button.state(); | 72 Button::ButtonState state = button.state(); |
| 82 if (button.style() == Button::STYLE_BUTTON && | 73 if (button.style() == Button::STYLE_BUTTON && |
| (...skipping 14 matching lines...) Expand all Loading... |
| 97 colors[Button::STATE_PRESSED] = | 88 colors[Button::STATE_PRESSED] = |
| 98 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHighlightColor); | 89 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHighlightColor); |
| 99 } | 90 } |
| 100 | 91 |
| 101 // static | 92 // static |
| 102 void PlatformStyle::OnTextfieldKeypressUnhandled() { | 93 void PlatformStyle::OnTextfieldKeypressUnhandled() { |
| 103 NSBeep(); | 94 NSBeep(); |
| 104 } | 95 } |
| 105 | 96 |
| 106 } // namespace views | 97 } // namespace views |
| OLD | NEW |