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/history2_ui.h" | 5 #include "chrome/browser/dom_ui/history2_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 HistoryUIHTMLSource2::GetMimeType(const std::string&) const { |
| 111 return "text/html"; |
| 112 } |
| 113 |
110 //////////////////////////////////////////////////////////////////////////////// | 114 //////////////////////////////////////////////////////////////////////////////// |
111 // | 115 // |
112 // HistoryHandler | 116 // HistoryHandler |
113 // | 117 // |
114 //////////////////////////////////////////////////////////////////////////////// | 118 //////////////////////////////////////////////////////////////////////////////// |
115 BrowsingHistoryHandler2::BrowsingHistoryHandler2() | 119 BrowsingHistoryHandler2::BrowsingHistoryHandler2() |
116 : search_text_() { | 120 : search_text_() { |
117 } | 121 } |
118 | 122 |
119 BrowsingHistoryHandler2::~BrowsingHistoryHandler2() { | 123 BrowsingHistoryHandler2::~BrowsingHistoryHandler2() { |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 const GURL HistoryUI2::GetHistoryURLWithSearchText(const string16& text) { | 411 const GURL HistoryUI2::GetHistoryURLWithSearchText(const string16& text) { |
408 return GURL(std::string(chrome::kChromeUIHistory2URL) + "#q=" + | 412 return GURL(std::string(chrome::kChromeUIHistory2URL) + "#q=" + |
409 EscapeQueryParamValue(UTF16ToUTF8(text), true)); | 413 EscapeQueryParamValue(UTF16ToUTF8(text), true)); |
410 } | 414 } |
411 | 415 |
412 // static | 416 // static |
413 RefCountedMemory* HistoryUI2::GetFaviconResourceBytes() { | 417 RefCountedMemory* HistoryUI2::GetFaviconResourceBytes() { |
414 return ResourceBundle::GetSharedInstance(). | 418 return ResourceBundle::GetSharedInstance(). |
415 LoadDataResourceBytes(IDR_HISTORY_FAVICON); | 419 LoadDataResourceBytes(IDR_HISTORY_FAVICON); |
416 } | 420 } |
OLD | NEW |