| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_gtk.h" | 5 #include "ui/views/controls/combobox/native_combobox_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 void NativeComboboxGtk::UpdateSelectedItem() { | 56 void NativeComboboxGtk::UpdateSelectedItem() { |
| 57 if (!native_view()) | 57 if (!native_view()) |
| 58 return; | 58 return; |
| 59 gtk_combo_box_set_active( | 59 gtk_combo_box_set_active( |
| 60 GTK_COMBO_BOX(native_view()), combobox_->selected_item()); | 60 GTK_COMBO_BOX(native_view()), combobox_->selected_item()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void NativeComboboxGtk::UpdateEnabled() { | 63 void NativeComboboxGtk::UpdateEnabled() { |
| 64 SetEnabled(combobox_->IsEnabled()); | 64 SetEnabled(combobox_->enabled()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 int NativeComboboxGtk::GetSelectedItem() const { | 67 int NativeComboboxGtk::GetSelectedItem() const { |
| 68 if (!native_view()) | 68 if (!native_view()) |
| 69 return 0; | 69 return 0; |
| 70 return gtk_combo_box_get_active(GTK_COMBO_BOX(native_view())); | 70 return gtk_combo_box_get_active(GTK_COMBO_BOX(native_view())); |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool NativeComboboxGtk::IsDropdownOpen() const { | 73 bool NativeComboboxGtk::IsDropdownOpen() const { |
| 74 if (!native_view()) | 74 if (!native_view()) |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 // static | 220 // static |
| 221 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( | 221 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( |
| 222 Combobox* combobox) { | 222 Combobox* combobox) { |
| 223 if (Widget::IsPureViews()) | 223 if (Widget::IsPureViews()) |
| 224 return new NativeComboboxViews(combobox); | 224 return new NativeComboboxViews(combobox); |
| 225 return new NativeComboboxGtk(combobox); | 225 return new NativeComboboxGtk(combobox); |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace views | 228 } // namespace views |
| OLD | NEW |