diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-22 16:49:37 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-22 16:49:37 +0000 |
commit | a88fe62cc7255cccd97dc4f13cb6f6f0b5b77fe2 (patch) | |
tree | e05c5e6959584c84cef55647d9bf1e4bbb2217d9 /views/controls | |
parent | e7afe2458ed03e907601cd3c05dc5f253f824d88 (diff) | |
download | chromium_src-a88fe62cc7255cccd97dc4f13cb6f6f0b5b77fe2.zip chromium_src-a88fe62cc7255cccd97dc4f13cb6f6f0b5b77fe2.tar.gz chromium_src-a88fe62cc7255cccd97dc4f13cb6f6f0b5b77fe2.tar.bz2 |
Remove wstrings from bookmarks, part 12.
- This changes RecentlyUsedFoldersComboModel::GetItemAt() to return a string16
instead of a wstring.
- This entailed changing the base class, ComboboxModel, and shaving a herd of
yaks.
BUG=23581
TEST=builds and passes tests
Review URL: http://codereview.chromium.org/3159031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57021 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r-- | views/controls/combobox/combobox.cc | 3 | ||||
-rw-r--r-- | views/controls/combobox/native_combobox_gtk.cc | 2 | ||||
-rw-r--r-- | views/controls/combobox/native_combobox_win.cc | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/views/controls/combobox/combobox.cc b/views/controls/combobox/combobox.cc index e213bdc..0c24a0d 100644 --- a/views/controls/combobox/combobox.cc +++ b/views/controls/combobox/combobox.cc @@ -7,6 +7,7 @@ #include "app/combobox_model.h" #include "base/keyboard_codes.h" #include "base/logging.h" +#include "base/utf_string_conversions.h" #include "views/controls/combobox/native_combobox_wrapper.h" #include "views/controls/native/native_view_host.h" @@ -96,7 +97,7 @@ bool Combobox::GetAccessibleRole(AccessibilityTypes::Role* role) { bool Combobox::GetAccessibleValue(std::wstring* value) { DCHECK(value); - *value = model_->GetItemAt(selected_item_); + *value = UTF16ToWideHack(model_->GetItemAt(selected_item_)); return true; } diff --git a/views/controls/combobox/native_combobox_gtk.cc b/views/controls/combobox/native_combobox_gtk.cc index 61e187a..f756171 100644 --- a/views/controls/combobox/native_combobox_gtk.cc +++ b/views/controls/combobox/native_combobox_gtk.cc @@ -44,7 +44,7 @@ void NativeComboboxGtk::UpdateFromModel() { while (count-- > 0) { gtk_list_store_prepend(store, &iter); gtk_list_store_set(store, &iter, - 0, WideToUTF8(model->GetItemAt(count)).c_str(), + 0, UTF16ToUTF8(model->GetItemAt(count)).c_str(), -1); } } diff --git a/views/controls/combobox/native_combobox_win.cc b/views/controls/combobox/native_combobox_win.cc index b1bc88f..720e51f 100644 --- a/views/controls/combobox/native_combobox_win.cc +++ b/views/controls/combobox/native_combobox_win.cc @@ -7,6 +7,7 @@ #include "app/combobox_model.h" #include "app/resource_bundle.h" #include "base/i18n/rtl.h" +#include "base/utf_string_conversions.h" #include "gfx/font.h" #include "gfx/native_theme_win.h" #include "views/controls/combobox/combobox.h" @@ -46,7 +47,7 @@ void NativeComboboxWin::UpdateFromModel() { int max_width = 0; int num_items = combobox_->model()->GetItemCount(); for (int i = 0; i < num_items; ++i) { - const std::wstring& text = combobox_->model()->GetItemAt(i); + const std::wstring& text = UTF16ToWide(combobox_->model()->GetItemAt(i)); // Inserting the Unicode formatting characters if necessary so that the // text is displayed correctly in right-to-left UIs. |