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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs); | 90 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs); |
91 } | 91 } |
92 ~TransparentButton() override {} | 92 ~TransparentButton() override {} |
93 | 93 |
94 bool OnMousePressed(const ui::MouseEvent& mouse_event) override { | 94 bool OnMousePressed(const ui::MouseEvent& mouse_event) override { |
95 parent()->RequestFocus(); | 95 parent()->RequestFocus(); |
96 return true; | 96 return true; |
97 } | 97 } |
98 | 98 |
99 double GetAnimationValue() const { | 99 double GetAnimationValue() const { |
100 return hover_animation_->GetCurrentValue(); | 100 return hover_animation().GetCurrentValue(); |
101 } | 101 } |
102 | 102 |
103 private: | 103 private: |
104 DISALLOW_COPY_AND_ASSIGN(TransparentButton); | 104 DISALLOW_COPY_AND_ASSIGN(TransparentButton); |
105 }; | 105 }; |
106 | 106 |
107 // Returns the next or previous valid index (depending on |increment|'s value). | 107 // Returns the next or previous valid index (depending on |increment|'s value). |
108 // Skips separator or disabled indices. Returns -1 if there is no valid adjacent | 108 // Skips separator or disabled indices. Returns -1 if there is no valid adjacent |
109 // index. | 109 // index. |
110 int GetAdjacentIndex(ui::ComboboxModel* model, int increment, int index) { | 110 int GetAdjacentIndex(ui::ComboboxModel* model, int increment, int index) { |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 return gfx::Size(width, font_list.GetHeight()); | 922 return gfx::Size(width, font_list.GetHeight()); |
923 } | 923 } |
924 | 924 |
925 PrefixSelector* Combobox::GetPrefixSelector() { | 925 PrefixSelector* Combobox::GetPrefixSelector() { |
926 if (!selector_) | 926 if (!selector_) |
927 selector_.reset(new PrefixSelector(this)); | 927 selector_.reset(new PrefixSelector(this)); |
928 return selector_.get(); | 928 return selector_.get(); |
929 } | 929 } |
930 | 930 |
931 } // namespace views | 931 } // namespace views |
OLD | NEW |