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

Side by Side Diff: chrome/browser/gtk/keyword_editor_view_unittest.cc

Issue 6044007: Remove wstring from TableModel.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/gtk/keyword_editor_view.h" 5 #include "chrome/browser/gtk/keyword_editor_view.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 GtkTreeIter iter; 61 GtkTreeIter iter;
62 if (!gtk_tree_model_get_iter_first(tree_model, &iter)) 62 if (!gtk_tree_model_get_iter_first(tree_model, &iter))
63 return std::string(); 63 return std::string();
64 while (true) { 64 while (true) {
65 gchar* name; 65 gchar* name;
66 gboolean is_header; 66 gboolean is_header;
67 gtk_tree_model_get(tree_model, &iter, 67 gtk_tree_model_get(tree_model, &iter,
68 KeywordEditorView::COL_TITLE, &name, 68 KeywordEditorView::COL_TITLE, &name,
69 KeywordEditorView::COL_IS_HEADER, &is_header, 69 KeywordEditorView::COL_IS_HEADER, &is_header,
70 -1); 70 -1);
71 if (name && WideToUTF8(groups[0].title) == name) 71 if (name && UTF16ToUTF8(groups[0].title) == name)
72 parts.push_back("!"); 72 parts.push_back("!");
73 else if (name && WideToUTF8(groups[1].title) == name) 73 else if (name && UTF16ToUTF8(groups[1].title) == name)
74 parts.push_back("@"); 74 parts.push_back("@");
75 else if (is_header) 75 else if (is_header)
76 parts.push_back("_"); 76 parts.push_back("_");
77 else if (name) 77 else if (name)
78 parts.push_back(name); 78 parts.push_back(name);
79 else 79 else
80 parts.push_back("???"); 80 parts.push_back("???");
81 if (name) 81 if (name)
82 g_free(name); 82 g_free(name);
83 if (!gtk_tree_model_iter_next(tree_model, &iter)) 83 if (!gtk_tree_model_iter_next(tree_model, &iter))
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 editor.OnEditedKeyword(d, ASCIIToUTF16("DD"), ASCIIToUTF16("d"), 262 editor.OnEditedKeyword(d, ASCIIToUTF16("DD"), ASCIIToUTF16("d"),
263 "example.com"); 263 "example.com");
264 EXPECT_STREQ("!,_,AA,BBB,_,@,_,C,DD", 264 EXPECT_STREQ("!,_,AA,BBB,_,@,_,C,DD",
265 GetDisplayedEngines(editor).c_str()); 265 GetDisplayedEngines(editor).c_str());
266 266
267 editor.OnEditedKeyword(c, ASCIIToUTF16("CC"), ASCIIToUTF16("cc"), 267 editor.OnEditedKeyword(c, ASCIIToUTF16("CC"), ASCIIToUTF16("cc"),
268 "example.com"); 268 "example.com");
269 EXPECT_STREQ("!,_,AA,BBB,_,@,_,CC,DD", 269 EXPECT_STREQ("!,_,AA,BBB,_,@,_,CC,DD",
270 GetDisplayedEngines(editor).c_str()); 270 GetDisplayedEngines(editor).c_str());
271 } 271 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698