Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: ui/views/controls/combobox/combobox.cc

Issue 9965017: views: Rename ComboboxListener::ItemChanged to something more accurate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: combo_box -> combobox Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/keycodes/keyboard_codes.h" 10 #include "ui/base/keycodes/keyboard_codes.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 PreferredSizeChanged(); 47 PreferredSizeChanged();
48 } 48 }
49 49
50 void Combobox::SetSelectedIndex(int index) { 50 void Combobox::SetSelectedIndex(int index) {
51 selected_index_ = index; 51 selected_index_ = index;
52 if (native_wrapper_) 52 if (native_wrapper_)
53 native_wrapper_->UpdateSelectedIndex(); 53 native_wrapper_->UpdateSelectedIndex();
54 } 54 }
55 55
56 void Combobox::SelectionChanged() { 56 void Combobox::SelectionChanged() {
57 int prev_selected_index = selected_index_;
58 selected_index_ = native_wrapper_->GetSelectedIndex(); 57 selected_index_ = native_wrapper_->GetSelectedIndex();
59 if (listener_) 58 if (listener_)
60 listener_->ItemChanged(this, prev_selected_index, selected_index_); 59 listener_->OnSelectedIndexChanged(this);
61 if (GetWidget()) { 60 if (GetWidget()) {
62 GetWidget()->NotifyAccessibilityEvent( 61 GetWidget()->NotifyAccessibilityEvent(
63 this, ui::AccessibilityTypes::EVENT_VALUE_CHANGED, false); 62 this, ui::AccessibilityTypes::EVENT_VALUE_CHANGED, false);
64 } 63 }
65 } 64 }
66 65
67 void Combobox::SetAccessibleName(const string16& name) { 66 void Combobox::SetAccessibleName(const string16& name) {
68 accessible_name_ = name; 67 accessible_name_ = name;
69 } 68 }
70 69
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 native_wrapper_->UpdateSelectedIndex(); 147 native_wrapper_->UpdateSelectedIndex();
149 native_wrapper_->UpdateEnabled(); 148 native_wrapper_->UpdateEnabled();
150 } 149 }
151 } 150 }
152 151
153 std::string Combobox::GetClassName() const { 152 std::string Combobox::GetClassName() const {
154 return kViewClassName; 153 return kViewClassName;
155 } 154 }
156 155
157 } // namespace views 156 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/cookie_info_view.cc ('k') | ui/views/controls/combobox/combobox_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698