summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-26 04:48:36 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-26 04:48:36 +0000
commit4a813cc835bcd26f2c2eea3fd734644a58ec45f2 (patch)
tree9cb3cc12a48996b180e32e5a1f5c8953034e25ce /chrome/browser/bookmarks
parent5ab53cb17b7abd215b2c0d373b16058879a7b5c0 (diff)
downloadchromium_src-4a813cc835bcd26f2c2eea3fd734644a58ec45f2.zip
chromium_src-4a813cc835bcd26f2c2eea3fd734644a58ec45f2.tar.gz
chromium_src-4a813cc835bcd26f2c2eea3fd734644a58ec45f2.tar.bz2
Remove wstrings from bookmarks, part 16.
This removes calls to the wstring GetTitle() method (in bookmarks). BUG=23581 TEST=builds and passes tests Review URL: http://codereview.chromium.org/3166036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks')
-rw-r--r--chrome/browser/bookmarks/bookmark_drag_data_unittest.cc6
-rw-r--r--chrome/browser/bookmarks/bookmark_model.cc7
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.cc2
3 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/bookmarks/bookmark_drag_data_unittest.cc b/chrome/browser/bookmarks/bookmark_drag_data_unittest.cc
index 8da227e..af98213 100644
--- a/chrome/browser/bookmarks/bookmark_drag_data_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_drag_data_unittest.cc
@@ -126,7 +126,8 @@ TEST_F(BookmarkDragDataTest, Group) {
BookmarkDragData drag_data(g12);
EXPECT_TRUE(drag_data.is_valid());
ASSERT_EQ(1, drag_data.elements.size());
- EXPECT_EQ(g12->GetTitle(), drag_data.elements[0].title);
+ EXPECT_EQ(g12->GetTitleAsString16(),
+ WideToUTF16Hack(drag_data.elements[0].title));
EXPECT_FALSE(drag_data.elements[0].is_url);
OSExchangeData data;
@@ -138,7 +139,8 @@ TEST_F(BookmarkDragDataTest, Group) {
EXPECT_TRUE(read_data.Read(data2));
EXPECT_TRUE(read_data.is_valid());
ASSERT_EQ(1, read_data.elements.size());
- EXPECT_EQ(g12->GetTitle(), read_data.elements[0].title);
+ EXPECT_EQ(g12->GetTitleAsString16(),
+ WideToUTF16Hack(read_data.elements[0].title));
EXPECT_FALSE(read_data.elements[0].is_url);
// We should get back the same node when asking for the same profile.
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc
index 384e32b..7aaf761 100644
--- a/chrome/browser/bookmarks/bookmark_model.cc
+++ b/chrome/browser/bookmarks/bookmark_model.cc
@@ -93,9 +93,10 @@ class SortComparator : public std::binary_function<const BookmarkNode*,
if (n1->type() == n2->type()) {
// Types are the same, compare the names.
if (!collator_)
- return n1->GetTitle() < n2->GetTitle();
- return l10n_util::CompareStringWithCollator(collator_, n1->GetTitle(),
- n2->GetTitle()) == UCOL_LESS;
+ return n1->GetTitleAsString16() < n2->GetTitleAsString16();
+ return l10n_util::CompareStringWithCollator(collator_,
+ UTF16ToWideHack(n1->GetTitleAsString16()),
+ UTF16ToWideHack(n2->GetTitleAsString16())) == UCOL_LESS;
}
// Types differ, sort such that folders come first.
return n1->is_folder();
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
index 4a52ec2..47ef996 100644
--- a/chrome/browser/bookmarks/bookmark_utils.cc
+++ b/chrome/browser/bookmarks/bookmark_utils.cc
@@ -193,7 +193,7 @@ bool DoesBookmarkContainWords(const BookmarkNode* node,
const std::string& languages) {
return
DoesBookmarkTextContainWords(
- l10n_util::ToLower(WideToUTF16(node->GetTitle())), words) ||
+ l10n_util::ToLower(node->GetTitleAsString16()), words) ||
DoesBookmarkTextContainWords(
l10n_util::ToLower(UTF8ToUTF16(node->GetURL().spec())), words) ||
DoesBookmarkTextContainWords(l10n_util::ToLower(