| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 const std::string full_html = jstemplate_builder::GetI18nTemplateHtml( | 100 const std::string full_html = jstemplate_builder::GetI18nTemplateHtml( |
| 101 history_html, &localized_strings); | 101 history_html, &localized_strings); |
| 102 | 102 |
| 103 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); | 103 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); |
| 104 html_bytes->data.resize(full_html.size()); | 104 html_bytes->data.resize(full_html.size()); |
| 105 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); | 105 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); |
| 106 | 106 |
| 107 SendResponse(request_id, html_bytes); | 107 SendResponse(request_id, html_bytes); |
| 108 } | 108 } |
| 109 | 109 |
| 110 std::string HistoryUIHTMLSource::GetMimeType(const std::string&) const { |
| 111 return "text/html"; |
| 112 } |
| 113 |
| 110 //////////////////////////////////////////////////////////////////////////////// | 114 //////////////////////////////////////////////////////////////////////////////// |
| 111 // | 115 // |
| 112 // HistoryHandler | 116 // HistoryHandler |
| 113 // | 117 // |
| 114 //////////////////////////////////////////////////////////////////////////////// | 118 //////////////////////////////////////////////////////////////////////////////// |
| 115 BrowsingHistoryHandler::BrowsingHistoryHandler() | 119 BrowsingHistoryHandler::BrowsingHistoryHandler() |
| 116 : search_text_() { | 120 : search_text_() { |
| 117 } | 121 } |
| 118 | 122 |
| 119 BrowsingHistoryHandler::~BrowsingHistoryHandler() { | 123 BrowsingHistoryHandler::~BrowsingHistoryHandler() { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) { | 399 const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) { |
| 396 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + | 400 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + |
| 397 EscapeQueryParamValue(UTF16ToUTF8(text), true)); | 401 EscapeQueryParamValue(UTF16ToUTF8(text), true)); |
| 398 } | 402 } |
| 399 | 403 |
| 400 // static | 404 // static |
| 401 RefCountedMemory* HistoryUI::GetFaviconResourceBytes() { | 405 RefCountedMemory* HistoryUI::GetFaviconResourceBytes() { |
| 402 return ResourceBundle::GetSharedInstance(). | 406 return ResourceBundle::GetSharedInstance(). |
| 403 LoadDataResourceBytes(IDR_HISTORY_FAVICON); | 407 LoadDataResourceBytes(IDR_HISTORY_FAVICON); |
| 404 } | 408 } |
| OLD | NEW |