| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/controls/combobox/combobox.h" | 5 #include "ui/views/controls/combobox/combobox.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 source_type = ui::MENU_SOURCE_TOUCH; | 758 source_type = ui::MENU_SOURCE_TOUCH; |
| 759 ShowDropDownMenu(source_type); | 759 ShowDropDownMenu(source_type); |
| 760 } | 760 } |
| 761 } | 761 } |
| 762 | 762 |
| 763 void Combobox::UpdateBorder() { | 763 void Combobox::UpdateBorder() { |
| 764 std::unique_ptr<FocusableBorder> border(new FocusableBorder()); | 764 std::unique_ptr<FocusableBorder> border(new FocusableBorder()); |
| 765 if (style_ == STYLE_ACTION) | 765 if (style_ == STYLE_ACTION) |
| 766 border->SetInsets(5, 10, 5, 10); | 766 border->SetInsets(5, 10, 5, 10); |
| 767 if (invalid_) | 767 if (invalid_) |
| 768 border->SetColor(gfx::kGoogleRed700); | 768 border->SetColorId(ui::NativeTheme::kColorId_AlertSeverityHigh); |
| 769 SetBorder(std::move(border)); | 769 SetBorder(std::move(border)); |
| 770 } | 770 } |
| 771 | 771 |
| 772 void Combobox::AdjustBoundsForRTLUI(gfx::Rect* rect) const { | 772 void Combobox::AdjustBoundsForRTLUI(gfx::Rect* rect) const { |
| 773 rect->set_x(GetMirroredXForRect(*rect)); | 773 rect->set_x(GetMirroredXForRect(*rect)); |
| 774 } | 774 } |
| 775 | 775 |
| 776 void Combobox::PaintText(gfx::Canvas* canvas) { | 776 void Combobox::PaintText(gfx::Canvas* canvas) { |
| 777 gfx::Insets insets = GetInsets(); | 777 gfx::Insets insets = GetInsets(); |
| 778 insets += gfx::Insets(0, Textfield::kTextPadding, 0, Textfield::kTextPadding); | 778 insets += gfx::Insets(0, Textfield::kTextPadding, 0, Textfield::kTextPadding); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 const int kMdPaddingWidth = 8; | 990 const int kMdPaddingWidth = 8; |
| 991 int arrow_pad = UseMd() ? kMdPaddingWidth | 991 int arrow_pad = UseMd() ? kMdPaddingWidth |
| 992 : PlatformStyle::kComboboxNormalArrowPadding; | 992 : PlatformStyle::kComboboxNormalArrowPadding; |
| 993 int padding = style_ == STYLE_NORMAL | 993 int padding = style_ == STYLE_NORMAL |
| 994 ? arrow_pad * 2 | 994 ? arrow_pad * 2 |
| 995 : kActionLeftPadding + kActionRightPadding; | 995 : kActionLeftPadding + kActionRightPadding; |
| 996 return ArrowSize().width() + padding; | 996 return ArrowSize().width() + padding; |
| 997 } | 997 } |
| 998 | 998 |
| 999 } // namespace views | 999 } // namespace views |
| OLD | NEW |