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

Unified Diff: ui/views/controls/combobox/native_combobox_win.cc

Issue 9875001: views: Rename Combobox "selected getter/setter" accessors to something more accurate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/combobox/native_combobox_win.cc
diff --git a/ui/views/controls/combobox/native_combobox_win.cc b/ui/views/controls/combobox/native_combobox_win.cc
index 73eed422a3849fe9cda0781cdff0bcb1ffebf363..dd18b3c81965a4fbc6ca93c743a8f50d8cb73085 100644
--- a/ui/views/controls/combobox/native_combobox_win.cc
+++ b/ui/views/controls/combobox/native_combobox_win.cc
@@ -65,7 +65,7 @@ void NativeComboboxWin::UpdateFromModel() {
content_width_ = max_width;
if (num_items > 0) {
- SendMessage(native_view(), CB_SETCURSEL, combobox_->selected_item(), 0);
+ SendMessage(native_view(), CB_SETCURSEL, combobox_->selected_index(), 0);
// Set the width for the drop down while accounting for the scrollbar and
// borders.
@@ -78,23 +78,23 @@ void NativeComboboxWin::UpdateFromModel() {
}
}
-void NativeComboboxWin::UpdateSelectedItem() {
+void NativeComboboxWin::UpdateSelectedIndex() {
// Note that we use CB_SETCURSEL and not CB_SELECTSTRING because on RTL
// locales the strings we get from our ComboBox::Model might be augmented
// with Unicode directionality marks before we insert them into the combo box
// and therefore we can not assume that the string we get from
// ComboBox::Model can be safely searched for and selected (which is what
// CB_SELECTSTRING does).
- SendMessage(native_view(), CB_SETCURSEL, combobox_->selected_item(), 0);
+ SendMessage(native_view(), CB_SETCURSEL, combobox_->selected_index(), 0);
}
void NativeComboboxWin::UpdateEnabled() {
SetEnabled(combobox_->enabled());
}
-int NativeComboboxWin::GetSelectedItem() const {
- LRESULT selected_item = SendMessage(native_view(), CB_GETCURSEL, 0, 0);
- return selected_item != CB_ERR ? selected_item : -1;
+int NativeComboboxWin::GetSelectedIndex() const {
+ LRESULT selected_index = SendMessage(native_view(), CB_GETCURSEL, 0, 0);
+ return selected_index != CB_ERR ? selected_index : -1;
}
bool NativeComboboxWin::IsDropdownOpen() const {

Powered by Google App Engine
This is Rietveld 408576698