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