| 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 "ui/gfx/paint_vector_icon.h" |
| 8 #include "ui/gfx/vector_icons.h" |
| 7 #include "ui/views/controls/button/label_button.h" | 9 #include "ui/views/controls/button/label_button.h" |
| 8 #include "ui/views/controls/button/label_button_border.h" | 10 #include "ui/views/controls/button/label_button_border.h" |
| 9 #include "ui/views/controls/focusable_rounded_border_mac.h" | 11 #include "ui/views/controls/focusable_rounded_border_mac.h" |
| 10 #import "ui/views/controls/scrollbar/cocoa_scroll_bar.h" | 12 #import "ui/views/controls/scrollbar/cocoa_scroll_bar.h" |
| 11 #include "ui/views/style/mac/combobox_background_mac.h" | 13 #include "ui/views/style/mac/combobox_background_mac.h" |
| 12 #include "ui/views/style/mac/dialog_button_border_mac.h" | 14 #include "ui/views/style/mac/dialog_button_border_mac.h" |
| 13 | 15 |
| 14 namespace views { | 16 namespace views { |
| 15 | 17 |
| 16 // static | 18 // static |
| 19 gfx::ImageSkia PlatformStyle::CreateComboboxArrow(bool is_enabled) { |
| 20 const int kComboboxArrowWidth = 13; |
| 21 return gfx::CreateVectorIcon(gfx::VectorIconId::COMBOBOX_ARROW_MAC, |
| 22 kComboboxArrowWidth, |
| 23 is_enabled ? SK_ColorWHITE : SK_ColorBLACK); |
| 24 } |
| 25 |
| 26 // static |
| 17 scoped_ptr<FocusableBorder> PlatformStyle::CreateComboboxBorder() { | 27 scoped_ptr<FocusableBorder> PlatformStyle::CreateComboboxBorder() { |
| 18 return make_scoped_ptr(new FocusableRoundedBorder); | 28 return make_scoped_ptr(new FocusableRoundedBorder); |
| 19 } | 29 } |
| 20 | 30 |
| 21 // static | 31 // static |
| 22 scoped_ptr<Background> PlatformStyle::CreateComboboxBackground() { | 32 scoped_ptr<Background> PlatformStyle::CreateComboboxBackground() { |
| 23 return make_scoped_ptr(new ComboboxBackgroundMac); | 33 return make_scoped_ptr(new ComboboxBackgroundMac); |
| 24 } | 34 } |
| 25 | 35 |
| 26 // static | 36 // static |
| 27 scoped_ptr<LabelButtonBorder> PlatformStyle::CreateLabelButtonBorder( | 37 scoped_ptr<LabelButtonBorder> PlatformStyle::CreateLabelButtonBorder( |
| 28 Button::ButtonStyle style) { | 38 Button::ButtonStyle style) { |
| 29 if (style == Button::STYLE_BUTTON) | 39 if (style == Button::STYLE_BUTTON) |
| 30 return make_scoped_ptr(new DialogButtonBorderMac()); | 40 return make_scoped_ptr(new DialogButtonBorderMac()); |
| 31 | 41 |
| 32 return make_scoped_ptr(new LabelButtonAssetBorder(style)); | 42 return make_scoped_ptr(new LabelButtonAssetBorder(style)); |
| 33 } | 43 } |
| 34 | 44 |
| 35 // static | 45 // static |
| 36 scoped_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { | 46 scoped_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { |
| 37 return make_scoped_ptr(new CocoaScrollBar(is_horizontal)); | 47 return make_scoped_ptr(new CocoaScrollBar(is_horizontal)); |
| 38 } | 48 } |
| 39 | 49 |
| 40 } // namespace views | 50 } // namespace views |
| OLD | NEW |