| 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/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" |
| 11 #include "ui/resources/grit/ui_resources.h" | 11 #include "ui/resources/grit/ui_resources.h" |
| 12 #include "ui/views/controls/button/label_button.h" | 12 #include "ui/views/controls/button/label_button.h" |
| 13 #include "ui/views/controls/button/label_button_border.h" | 13 #include "ui/views/controls/button/label_button_border.h" |
| 14 #include "ui/views/controls/focusable_rounded_border_mac.h" | 14 #include "ui/views/controls/focusable_rounded_border_mac.h" |
| 15 #import "ui/views/controls/scrollbar/cocoa_scroll_bar.h" | 15 #import "ui/views/controls/scrollbar/cocoa_scroll_bar.h" |
| 16 #include "ui/views/style/mac/combobox_background_mac.h" | 16 #include "ui/views/style/mac/combobox_background_mac.h" |
| 17 #include "ui/views/style/mac/dialog_button_border_mac.h" | 17 #include "ui/views/style/mac/dialog_button_border_mac.h" |
| 18 | 18 |
| 19 namespace views { | 19 namespace views { |
| 20 | 20 |
| 21 const int PlatformStyle::kMinLabelButtonWidth = 32; | 21 const int PlatformStyle::kMinLabelButtonWidth = 32; |
| 22 const int PlatformStyle::kMinLabelButtonHeight = 30; | 22 const int PlatformStyle::kMinLabelButtonHeight = 30; |
| 23 const bool PlatformStyle::kDefaultLabelButtonHasBoldFont = false; | 23 const bool PlatformStyle::kDefaultLabelButtonHasBoldFont = false; |
| 24 const bool PlatformStyle::kTextfieldDragVerticallyDragsToEnd = true; |
| 24 | 25 |
| 25 // static | 26 // static |
| 26 gfx::ImageSkia PlatformStyle::CreateComboboxArrow(bool is_enabled, | 27 gfx::ImageSkia PlatformStyle::CreateComboboxArrow(bool is_enabled, |
| 27 Combobox::Style style) { | 28 Combobox::Style style) { |
| 28 // TODO(ellyjones): IDR_MENU_DROPARROW is a cross-platform image that doesn't | 29 // TODO(ellyjones): IDR_MENU_DROPARROW is a cross-platform image that doesn't |
| 29 // look right on Mac. See https://crbug.com/384071. | 30 // look right on Mac. See https://crbug.com/384071. |
| 30 if (style == Combobox::STYLE_ACTION) { | 31 if (style == Combobox::STYLE_ACTION) { |
| 31 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 32 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 32 return *rb.GetImageSkiaNamed(IDR_MENU_DROPARROW); | 33 return *rb.GetImageSkiaNamed(IDR_MENU_DROPARROW); |
| 33 } | 34 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void PlatformStyle::ApplyLabelButtonTextStyle( | 80 void PlatformStyle::ApplyLabelButtonTextStyle( |
| 80 views::Label* label, | 81 views::Label* label, |
| 81 ButtonColorByState* color_by_state) { | 82 ButtonColorByState* color_by_state) { |
| 82 const ui::NativeTheme* theme = label->GetNativeTheme(); | 83 const ui::NativeTheme* theme = label->GetNativeTheme(); |
| 83 ButtonColorByState& colors = *color_by_state; | 84 ButtonColorByState& colors = *color_by_state; |
| 84 colors[Button::STATE_PRESSED] = | 85 colors[Button::STATE_PRESSED] = |
| 85 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHighlightColor); | 86 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHighlightColor); |
| 86 } | 87 } |
| 87 | 88 |
| 88 } // namespace views | 89 } // namespace views |
| OLD | NEW |