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

Unified Diff: views/examples/combobox_example.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/combobox/native_combobox_win.cc ('k') | views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/examples/combobox_example.h
diff --git a/views/examples/combobox_example.h b/views/examples/combobox_example.h
index d756eb53a8c472d31120eea8096516008e388690..3aad6ebcd84f2611ca035e5239358908f16f7c7f 100644
--- a/views/examples/combobox_example.h
+++ b/views/examples/combobox_example.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,6 +8,7 @@
#include "app/combobox_model.h"
#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
#include "views/controls/combobox/combobox.h"
#include "views/examples/example_base.h"
#include "views/fill_layout.h"
@@ -44,8 +45,8 @@ class ComboboxExample : public ExampleBase, public views::Combobox::Listener {
return 10;
}
- virtual std::wstring GetItemAt(int index) {
- return StringPrintf(L"Item %d", index);
+ virtual string16 GetItemAt(int index) {
+ return WideToUTF16Hack(StringPrintf(L"Item %d", index));
}
private:
@@ -57,7 +58,8 @@ class ComboboxExample : public ExampleBase, public views::Combobox::Listener {
int prev_index,
int new_index) {
PrintStatus(L"Selected: index=%d, label=%ls",
- new_index, combo_box->model()->GetItemAt(new_index).c_str());
+ new_index, UTF16ToWideHack(
+ combo_box->model()->GetItemAt(new_index)).c_str());
}
// This test only control.
« no previous file with comments | « views/controls/combobox/native_combobox_win.cc ('k') | views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698