| 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 arrow_bounds = | 762 arrow_bounds = |
| 763 PositionArrowWithinContainer(arrow_bounds, ArrowSize(), style_); | 763 PositionArrowWithinContainer(arrow_bounds, ArrowSize(), style_); |
| 764 AdjustBoundsForRTLUI(&arrow_bounds); | 764 AdjustBoundsForRTLUI(&arrow_bounds); |
| 765 | 765 |
| 766 canvas->DrawImageInt(arrow_image_, arrow_bounds.x(), arrow_bounds.y()); | 766 canvas->DrawImageInt(arrow_image_, arrow_bounds.x(), arrow_bounds.y()); |
| 767 } | 767 } |
| 768 | 768 |
| 769 void Combobox::PaintButtons(gfx::Canvas* canvas) { | 769 void Combobox::PaintButtons(gfx::Canvas* canvas) { |
| 770 DCHECK(style_ == STYLE_ACTION); | 770 DCHECK(style_ == STYLE_ACTION); |
| 771 | 771 |
| 772 gfx::ScopedRTLFlipCanvas scoped_canvas(canvas, bounds()); | 772 gfx::ScopedRTLFlipCanvas scoped_canvas(canvas, width()); |
| 773 | 773 |
| 774 bool focused = HasFocus(); | 774 bool focused = HasFocus(); |
| 775 const std::vector<const gfx::ImageSkia*>& arrow_button_images = | 775 const std::vector<const gfx::ImageSkia*>& arrow_button_images = |
| 776 menu_button_images_[focused][ | 776 menu_button_images_[focused][ |
| 777 arrow_button_->state() == Button::STATE_HOVERED ? | 777 arrow_button_->state() == Button::STATE_HOVERED ? |
| 778 Button::STATE_NORMAL : arrow_button_->state()]; | 778 Button::STATE_NORMAL : arrow_button_->state()]; |
| 779 | 779 |
| 780 int text_button_hover_alpha = | 780 int text_button_hover_alpha = |
| 781 text_button_->state() == Button::STATE_PRESSED ? 0 : | 781 text_button_->state() == Button::STATE_PRESSED ? 0 : |
| 782 static_cast<int>(static_cast<TransparentButton*>(text_button_)-> | 782 static_cast<int>(static_cast<TransparentButton*>(text_button_)-> |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 } | 905 } |
| 906 | 906 |
| 907 int Combobox::GetArrowContainerWidth() const { | 907 int Combobox::GetArrowContainerWidth() const { |
| 908 int padding = style_ == STYLE_NORMAL | 908 int padding = style_ == STYLE_NORMAL |
| 909 ? PlatformStyle::kComboboxNormalArrowPadding * 2 | 909 ? PlatformStyle::kComboboxNormalArrowPadding * 2 |
| 910 : kActionLeftPadding + kActionRightPadding; | 910 : kActionLeftPadding + kActionRightPadding; |
| 911 return ArrowSize().width() + padding; | 911 return ArrowSize().width() + padding; |
| 912 } | 912 } |
| 913 | 913 |
| 914 } // namespace views | 914 } // namespace views |
| OLD | NEW |