summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-09 17:01:37 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-09 17:01:37 +0000
commit489d73e7fca72f29bd6620e268609133aa217795 (patch)
treea3ea497ed6b15be2d9742821dd4a2f36a0d885ce /chrome/browser/dom_ui
parent60c413c96834553e182e8c9c34d1e8958f3b0fb5 (diff)
downloadchromium_src-489d73e7fca72f29bd6620e268609133aa217795.zip
chromium_src-489d73e7fca72f29bd6620e268609133aa217795.tar.gz
chromium_src-489d73e7fca72f29bd6620e268609133aa217795.tar.bz2
Run more unit tests on Linux:
- used string16 instead of wstring where needed - replaced GetTickCount calls with portable functions from base/time.h - misc GCC cleanups - enabled following unit tests on Linux: browser/autocomplete/history_contents_provider_unittest.cc browser/autocomplete/history_url_provider_unittest.cc browser/autocomplete/keyword_provider_unittest.cc browser/bookmarks/bookmark_html_writer_unittest.cc Review URL: http://codereview.chromium.org/39335 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11249 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 923f545..21cffa7 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -118,13 +118,15 @@ class PaintTimer : public RenderWidgetHost::PaintObserver {
// Adds "url", "title", and "direction" keys on incoming dictionary, setting
// title as the url as a fallback on empty title.
void SetURLTitleAndDirection(DictionaryValue* dictionary,
- const std::wstring& title,
+ const string16& title,
const GURL& gurl) {
std::wstring wstring_url = UTF8ToWide(gurl.spec());
dictionary->SetString(L"url", wstring_url);
+ std::wstring wstring_title = UTF16ToWide(title);
+
bool using_url_as_the_title = false;
- std::wstring title_to_set(title);
+ std::wstring title_to_set(wstring_title);
if (title_to_set.empty()) {
using_url_as_the_title = true;
title_to_set = wstring_url;
@@ -155,7 +157,7 @@ void SetURLTitleAndDirection(DictionaryValue* dictionary,
if (using_url_as_the_title) {
l10n_util::WrapStringWithLTRFormatting(&title_to_set);
} else {
- if (l10n_util::StringContainsStrongRTLChars(title)) {
+ if (l10n_util::StringContainsStrongRTLChars(wstring_title)) {
l10n_util::WrapStringWithRTLFormatting(&title_to_set);
direction = kRTLHtmlTextDirection;
} else {
@@ -525,7 +527,8 @@ void RecentlyBookmarkedHandler::SendBookmarksToPage() {
for (size_t i = 0; i < recently_bookmarked.size(); ++i) {
BookmarkNode* node = recently_bookmarked[i];
DictionaryValue* entry_value = new DictionaryValue;
- SetURLTitleAndDirection(entry_value, node->GetTitle(), node->GetURL());
+ SetURLTitleAndDirection(entry_value,
+ WideToUTF16(node->GetTitle()), node->GetURL());
list_value.Append(entry_value);
}
dom_ui_->CallJavascriptFunction(L"recentlyBookmarked", list_value);