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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "ui/base/accessibility/accessible_view_state.h" | 9 #include "ui/base/accessibility/accessible_view_state.h" |
10 #include "ui/base/events/event.h" | 10 #include "ui/base/events/event.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void Combobox::SetSelectedIndex(int index) { | 51 void Combobox::SetSelectedIndex(int index) { |
52 selected_index_ = index; | 52 selected_index_ = index; |
53 if (native_wrapper_) | 53 if (native_wrapper_) |
54 native_wrapper_->UpdateSelectedIndex(); | 54 native_wrapper_->UpdateSelectedIndex(); |
55 } | 55 } |
56 | 56 |
57 void Combobox::SelectionChanged() { | 57 void Combobox::SelectionChanged() { |
58 selected_index_ = native_wrapper_->GetSelectedIndex(); | 58 selected_index_ = native_wrapper_->GetSelectedIndex(); |
59 if (listener_) | 59 if (listener_) |
60 listener_->OnSelectedIndexChanged(this); | 60 listener_->OnSelectedIndexChanged(this); |
61 if (GetWidget()) { | 61 NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_VALUE_CHANGED, false); |
62 GetWidget()->NotifyAccessibilityEvent( | |
63 this, ui::AccessibilityTypes::EVENT_VALUE_CHANGED, false); | |
64 } | |
65 } | 62 } |
66 | 63 |
67 void Combobox::SetAccessibleName(const string16& name) { | 64 void Combobox::SetAccessibleName(const string16& name) { |
68 accessible_name_ = name; | 65 accessible_name_ = name; |
69 } | 66 } |
70 | 67 |
71 void Combobox::SetInvalid(bool invalid) { | 68 void Combobox::SetInvalid(bool invalid) { |
72 invalid_ = invalid; | 69 invalid_ = invalid; |
73 if (native_wrapper_) | 70 if (native_wrapper_) |
74 native_wrapper_->ValidityStateChanged(); | 71 native_wrapper_->ValidityStateChanged(); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 native_wrapper_->UpdateSelectedIndex(); | 153 native_wrapper_->UpdateSelectedIndex(); |
157 native_wrapper_->UpdateEnabled(); | 154 native_wrapper_->UpdateEnabled(); |
158 } | 155 } |
159 } | 156 } |
160 | 157 |
161 std::string Combobox::GetClassName() const { | 158 std::string Combobox::GetClassName() const { |
162 return kViewClassName; | 159 return kViewClassName; |
163 } | 160 } |
164 | 161 |
165 } // namespace views | 162 } // namespace views |
OLD | NEW |