diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-21 18:25:31 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-21 18:25:31 +0000 |
commit | 7caca8a26f5db3d6895f59a9037f87e7e4a0e680 (patch) | |
tree | 1b4c2a9f78f1686c25915fa64c65eecba3115824 /app | |
parent | c6fa07212403400534708111c0e7907af4299f5b (diff) | |
download | chromium_src-7caca8a26f5db3d6895f59a9037f87e7e4a0e680.zip chromium_src-7caca8a26f5db3d6895f59a9037f87e7e4a0e680.tar.gz chromium_src-7caca8a26f5db3d6895f59a9037f87e7e4a0e680.tar.bz2 |
Remove wstrings from bookmarks, part 7.
BUG=23581
TEST=builds and passes tests
Review URL: http://codereview.chromium.org/3140022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57000 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r-- | app/tree_node_model.h | 10 | ||||
-rw-r--r-- | app/tree_node_model_unittest.cc | 8 |
2 files changed, 7 insertions, 11 deletions
diff --git a/app/tree_node_model.h b/app/tree_node_model.h index bd1b4bc..4a1458b 100644 --- a/app/tree_node_model.h +++ b/app/tree_node_model.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -157,12 +157,6 @@ class TreeNode : public TreeModelNode { } // Sets the title of the node. - // TODO(munjal): Remove wstring overload once all code is moved to string16. -#if !defined(WCHAR_T_IS_UTF16) - void SetTitle(const std::wstring& string) { - title_ = WideToUTF16(string); - } -#endif void SetTitle(const string16& string) { title_ = string; } @@ -281,7 +275,7 @@ class TreeNodeModel : public TreeModel { virtual void SetTitle(TreeModelNode* node, const std::wstring& title) { DCHECK(node); - AsNode(node)->SetTitle(title); + AsNode(node)->SetTitle(WideToUTF16Hack(title)); NotifyObserverTreeNodeChanged(node); } diff --git a/app/tree_node_model_unittest.cc b/app/tree_node_model_unittest.cc index ce12b16..1b692ba 100644 --- a/app/tree_node_model_unittest.cc +++ b/app/tree_node_model_unittest.cc @@ -3,6 +3,8 @@ // found in the LICENSE file. #include "app/tree_node_model.h" +#include "base/string16.h" +#include "base/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" class TreeNodeModelTest : public testing::Test, public TreeModelObserver { @@ -278,8 +280,8 @@ TEST_F(TreeNodeModelTest, SetTitle) { model.AddObserver(this); ClearCounts(); - const std::wstring title(L"root2"); - model.SetTitle(root, title); + const string16 title(ASCIIToUTF16("root2")); + model.SetTitle(root, UTF16ToWideHack(title)); AssertObserverCount(0, 0, 1); - EXPECT_EQ(WideToUTF16(title), root->GetTitleAsString16()); + EXPECT_EQ(title, root->GetTitleAsString16()); } |