diff options
Diffstat (limited to 'chrome/browser/dom_ui/history_ui.cc')
-rw-r--r-- | chrome/browser/dom_ui/history_ui.cc | 74 |
1 files changed, 40 insertions, 34 deletions
diff --git a/chrome/browser/dom_ui/history_ui.cc b/chrome/browser/dom_ui/history_ui.cc index 9bc5d61..2423458 100644 --- a/chrome/browser/dom_ui/history_ui.cc +++ b/chrome/browser/dom_ui/history_ui.cc @@ -49,32 +49,34 @@ HistoryUIHTMLSource::HistoryUIHTMLSource() void HistoryUIHTMLSource::StartDataRequest(const std::string& path, int request_id) { DictionaryValue localized_strings; - localized_strings.SetString(L"title", - l10n_util::GetString(IDS_HISTORY_TITLE)); - localized_strings.SetString(L"loading", - l10n_util::GetString(IDS_HISTORY_LOADING)); - localized_strings.SetString(L"newest", - l10n_util::GetString(IDS_HISTORY_NEWEST)); - localized_strings.SetString(L"newer", - l10n_util::GetString(IDS_HISTORY_NEWER)); - localized_strings.SetString(L"older", - l10n_util::GetString(IDS_HISTORY_OLDER)); - localized_strings.SetString(L"searchresultsfor", - l10n_util::GetString(IDS_HISTORY_SEARCHRESULTSFOR)); - localized_strings.SetString(L"history", - l10n_util::GetString(IDS_HISTORY_BROWSERESULTS)); - localized_strings.SetString(L"cont", - l10n_util::GetString(IDS_HISTORY_CONTINUED)); - localized_strings.SetString(L"searchbutton", - l10n_util::GetString(IDS_HISTORY_SEARCH_BUTTON)); - localized_strings.SetString(L"noresults", - l10n_util::GetString(IDS_HISTORY_NO_RESULTS)); - localized_strings.SetString(L"noitems", - l10n_util::GetString(IDS_HISTORY_NO_ITEMS)); - localized_strings.SetString(L"deleteday", - l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_LINK)); - localized_strings.SetString(L"deletedaywarning", - l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING)); + localized_strings.SetString(ASCIIToUTF16("title"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_TITLE))); + localized_strings.SetString(ASCIIToUTF16("loading"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_LOADING))); + localized_strings.SetString(ASCIIToUTF16("newest"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_NEWEST))); + localized_strings.SetString(ASCIIToUTF16("newer"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_NEWER))); + localized_strings.SetString(ASCIIToUTF16("older"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_OLDER))); + localized_strings.SetString(ASCIIToUTF16("searchresultsfor"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_SEARCHRESULTSFOR))); + localized_strings.SetString(ASCIIToUTF16("history"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_BROWSERESULTS))); + localized_strings.SetString(ASCIIToUTF16("cont"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_CONTINUED))); + localized_strings.SetString(ASCIIToUTF16("searchbutton"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_SEARCH_BUTTON))); + localized_strings.SetString(ASCIIToUTF16("noresults"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_NO_RESULTS))); + localized_strings.SetString(ASCIIToUTF16("noitems"), + WideToUTF16Hack(l10n_util::GetString(IDS_HISTORY_NO_ITEMS))); + localized_strings.SetString(ASCIIToUTF16("deleteday"), + WideToUTF16Hack( + l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_LINK))); + localized_strings.SetString(ASCIIToUTF16("deletedaywarning"), + WideToUTF16Hack( + l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING))); static const StringPiece history_html( ResourceBundle::GetSharedInstance().GetRawDataResource( @@ -226,7 +228,7 @@ void BrowsingHistoryHandler::QueryComplete( SetURLAndTitle(page_value, page.title(), page.url()); // Need to pass the time in epoch time (fastest JS conversion). - page_value->SetInteger(L"time", + page_value->SetInteger(ASCIIToUTF16("time"), static_cast<int>(page.visit_time().ToTimeT())); // Until we get some JS i18n infrastructure, we also need to @@ -246,15 +248,19 @@ void BrowsingHistoryHandler::QueryComplete( IDS_HISTORY_DATE_WITH_RELATIVE_TIME, date_str, base::TimeFormatFriendlyDate(page.visit_time())); } - page_value->SetString(L"dateRelativeDay", date_str); - page_value->SetString(L"dateTimeOfDay", - base::TimeFormatTimeOfDay(page.visit_time())); + page_value->SetString(ASCIIToUTF16("dateRelativeDay"), + WideToUTF16Hack(date_str)); + page_value->SetString( + ASCIIToUTF16("dateTimeOfDay"), + WideToUTF16Hack(base::TimeFormatTimeOfDay(page.visit_time()))); } else { - page_value->SetString(L"dateShort", - base::TimeFormatShortDate(page.visit_time())); - page_value->SetString(L"snippet", page.snippet().text()); + page_value->SetString( + ASCIIToUTF16("dateShort"), + WideToUTF16Hack(base::TimeFormatShortDate(page.visit_time()))); + page_value->SetString( + ASCIIToUTF16("snippet"), WideToUTF16Hack(page.snippet().text())); } - page_value->SetBoolean(L"starred", + page_value->SetBoolean(ASCIIToUTF16("starred"), dom_ui_->get_profile()->GetBookmarkModel()->IsBookmarked(page.url())); results_value.Append(page_value); } |