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

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

Issue 3159031: Remove wstrings from bookmarks, part 12. (Closed)
Patch Set: rebased ToT Created 10 years, 4 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
« no previous file with comments | « views/controls/combobox/combobox.cc ('k') | views/controls/combobox/native_combobox_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "views/controls/combobox/native_combobox_gtk.h" 5 #include "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 26 matching lines...) Expand all
37 37
38 GtkListStore* store = 38 GtkListStore* store =
39 GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(native_view()))); 39 GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(native_view())));
40 ComboboxModel* model = combobox_->model(); 40 ComboboxModel* model = combobox_->model();
41 int count = model->GetItemCount(); 41 int count = model->GetItemCount();
42 gtk_list_store_clear(store); 42 gtk_list_store_clear(store);
43 GtkTreeIter iter; 43 GtkTreeIter iter;
44 while (count-- > 0) { 44 while (count-- > 0) {
45 gtk_list_store_prepend(store, &iter); 45 gtk_list_store_prepend(store, &iter);
46 gtk_list_store_set(store, &iter, 46 gtk_list_store_set(store, &iter,
47 0, WideToUTF8(model->GetItemAt(count)).c_str(), 47 0, UTF16ToUTF8(model->GetItemAt(count)).c_str(),
48 -1); 48 -1);
49 } 49 }
50 } 50 }
51 51
52 void NativeComboboxGtk::UpdateSelectedItem() { 52 void NativeComboboxGtk::UpdateSelectedItem() {
53 if (!native_view()) 53 if (!native_view())
54 return; 54 return;
55 gtk_combo_box_set_active( 55 gtk_combo_box_set_active(
56 GTK_COMBO_BOX(native_view()), combobox_->selected_item()); 56 GTK_COMBO_BOX(native_view()), combobox_->selected_item());
57 } 57 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 //////////////////////////////////////////////////////////////////////////////// 139 ////////////////////////////////////////////////////////////////////////////////
140 // NativeComboboxWrapper, public: 140 // NativeComboboxWrapper, public:
141 141
142 // static 142 // static
143 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( 143 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper(
144 Combobox* combobox) { 144 Combobox* combobox) {
145 return new NativeComboboxGtk(combobox); 145 return new NativeComboboxGtk(combobox);
146 } 146 }
147 147
148 } // namespace views 148 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/combobox/combobox.cc ('k') | views/controls/combobox/native_combobox_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698