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/native_combobox_views.h" | 5 #include "ui/views/controls/combobox/native_combobox_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
10 #include "ui/base/events/event.h" | 10 #include "ui/base/events/event.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 menu->AppendMenuItem(i + kFirstMenuItemId, text, MenuItemView::NORMAL); | 212 menu->AppendMenuItem(i + kFirstMenuItemId, text, MenuItemView::NORMAL); |
213 max_width = std::max(max_width, font.GetStringWidth(text)); | 213 max_width = std::max(max_width, font.GetStringWidth(text)); |
214 } | 214 } |
215 | 215 |
216 content_width_ = max_width; | 216 content_width_ = max_width; |
217 content_height_ = font.GetHeight(); | 217 content_height_ = font.GetHeight(); |
218 } | 218 } |
219 | 219 |
220 void NativeComboboxViews::UpdateSelectedIndex() { | 220 void NativeComboboxViews::UpdateSelectedIndex() { |
221 selected_index_ = combobox_->selected_index(); | 221 selected_index_ = combobox_->selected_index(); |
| 222 SchedulePaint(); |
222 } | 223 } |
223 | 224 |
224 void NativeComboboxViews::UpdateEnabled() { | 225 void NativeComboboxViews::UpdateEnabled() { |
225 SetEnabled(combobox_->enabled()); | 226 SetEnabled(combobox_->enabled()); |
226 } | 227 } |
227 | 228 |
228 int NativeComboboxViews::GetSelectedIndex() const { | 229 int NativeComboboxViews::GetSelectedIndex() const { |
229 return selected_index_; | 230 return selected_index_; |
230 } | 231 } |
231 | 232 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 | 410 |
410 #if defined(USE_AURA) | 411 #if defined(USE_AURA) |
411 // static | 412 // static |
412 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( | 413 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( |
413 Combobox* combobox) { | 414 Combobox* combobox) { |
414 return new NativeComboboxViews(combobox); | 415 return new NativeComboboxViews(combobox); |
415 } | 416 } |
416 #endif | 417 #endif |
417 | 418 |
418 } // namespace views | 419 } // namespace views |
OLD | NEW |