OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/dom_ui/history_ui.h" | 5 #include "chrome/browser/dom_ui/history_ui.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 l10n_util::GetString(IDS_HISTORY_NO_RESULTS)); | 72 l10n_util::GetString(IDS_HISTORY_NO_RESULTS)); |
73 localized_strings.SetString(L"noitems", | 73 localized_strings.SetString(L"noitems", |
74 l10n_util::GetString(IDS_HISTORY_NO_ITEMS)); | 74 l10n_util::GetString(IDS_HISTORY_NO_ITEMS)); |
75 localized_strings.SetString(L"deleteday", | 75 localized_strings.SetString(L"deleteday", |
76 l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_LINK)); | 76 l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_LINK)); |
77 localized_strings.SetString(L"deletedaywarning", | 77 localized_strings.SetString(L"deletedaywarning", |
78 l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING)); | 78 l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING)); |
79 | 79 |
80 SetFontAndTextDirection(&localized_strings); | 80 SetFontAndTextDirection(&localized_strings); |
81 | 81 |
82 static const StringPiece history_html( | 82 static const base::StringPiece history_html( |
83 ResourceBundle::GetSharedInstance().GetRawDataResource( | 83 ResourceBundle::GetSharedInstance().GetRawDataResource( |
84 IDR_HISTORY_HTML)); | 84 IDR_HISTORY_HTML)); |
85 const std::string full_html = jstemplate_builder::GetI18nTemplateHtml( | 85 const std::string full_html = jstemplate_builder::GetI18nTemplateHtml( |
86 history_html, &localized_strings); | 86 history_html, &localized_strings); |
87 | 87 |
88 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); | 88 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); |
89 html_bytes->data.resize(full_html.size()); | 89 html_bytes->data.resize(full_html.size()); |
90 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); | 90 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); |
91 | 91 |
92 SendResponse(request_id, html_bytes); | 92 SendResponse(request_id, html_bytes); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 const GURL HistoryUI::GetHistoryURLWithSearchText(const std::wstring& text) { | 377 const GURL HistoryUI::GetHistoryURLWithSearchText(const std::wstring& text) { |
378 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + | 378 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + |
379 EscapeQueryParamValue(WideToUTF8(text))); | 379 EscapeQueryParamValue(WideToUTF8(text))); |
380 } | 380 } |
381 | 381 |
382 // static | 382 // static |
383 bool HistoryUI::GetFaviconResourceBytes(std::vector<unsigned char>* bytes) { | 383 bool HistoryUI::GetFaviconResourceBytes(std::vector<unsigned char>* bytes) { |
384 return ResourceBundle::GetSharedInstance(). | 384 return ResourceBundle::GetSharedInstance(). |
385 LoadImageResourceBytes(IDR_HISTORY_FAVICON, bytes); | 385 LoadImageResourceBytes(IDR_HISTORY_FAVICON, bytes); |
386 } | 386 } |
OLD | NEW |