| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/downloads_ui.h" | 5 #include "chrome/browser/dom_ui/downloads_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/string_piece.h" | 9 #include "base/string_piece.h" |
| 10 #include "base/thread.h" | 10 #include "base/thread.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 l10n_util::GetString(IDS_DOWNLOAD_LINK_SHOW)); | 92 l10n_util::GetString(IDS_DOWNLOAD_LINK_SHOW)); |
| 93 localized_strings.SetString(L"control_cancel", | 93 localized_strings.SetString(L"control_cancel", |
| 94 l10n_util::GetString(IDS_DOWNLOAD_LINK_CANCEL)); | 94 l10n_util::GetString(IDS_DOWNLOAD_LINK_CANCEL)); |
| 95 localized_strings.SetString(L"control_resume", | 95 localized_strings.SetString(L"control_resume", |
| 96 l10n_util::GetString(IDS_DOWNLOAD_LINK_RESUME)); | 96 l10n_util::GetString(IDS_DOWNLOAD_LINK_RESUME)); |
| 97 localized_strings.SetString(L"control_removefromlist", | 97 localized_strings.SetString(L"control_removefromlist", |
| 98 l10n_util::GetString(IDS_DOWNLOAD_LINK_REMOVE)); | 98 l10n_util::GetString(IDS_DOWNLOAD_LINK_REMOVE)); |
| 99 | 99 |
| 100 SetFontAndTextDirection(&localized_strings); | 100 SetFontAndTextDirection(&localized_strings); |
| 101 | 101 |
| 102 static const StringPiece downloads_html( | 102 static const base::StringPiece downloads_html( |
| 103 ResourceBundle::GetSharedInstance().GetRawDataResource( | 103 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 104 IDR_DOWNLOADS_HTML)); | 104 IDR_DOWNLOADS_HTML)); |
| 105 const std::string full_html = jstemplate_builder::GetI18nTemplateHtml( | 105 const std::string full_html = jstemplate_builder::GetI18nTemplateHtml( |
| 106 downloads_html, &localized_strings); | 106 downloads_html, &localized_strings); |
| 107 | 107 |
| 108 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); | 108 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); |
| 109 html_bytes->data.resize(full_html.size()); | 109 html_bytes->data.resize(full_html.size()); |
| 110 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); | 110 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); |
| 111 | 111 |
| 112 SendResponse(request_id, html_bytes); | 112 SendResponse(request_id, html_bytes); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 136 NewRunnableMethod(&chrome_url_data_manager, | 136 NewRunnableMethod(&chrome_url_data_manager, |
| 137 &ChromeURLDataManager::AddDataSource, | 137 &ChromeURLDataManager::AddDataSource, |
| 138 html_source)); | 138 html_source)); |
| 139 } | 139 } |
| 140 | 140 |
| 141 // static | 141 // static |
| 142 bool DownloadsUI::GetFaviconResourceBytes(std::vector<unsigned char>* bytes) { | 142 bool DownloadsUI::GetFaviconResourceBytes(std::vector<unsigned char>* bytes) { |
| 143 return ResourceBundle::GetSharedInstance(). | 143 return ResourceBundle::GetSharedInstance(). |
| 144 LoadImageResourceBytes(IDR_DOWNLOADS_FAVICON, bytes); | 144 LoadImageResourceBytes(IDR_DOWNLOADS_FAVICON, bytes); |
| 145 } | 145 } |
| OLD | NEW |