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/singleton.h" | 9 #include "base/singleton.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
11 #include "base/thread.h" | 11 #include "base/thread.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/chrome_thread.h" | 13 #include "chrome/browser/chrome_thread.h" |
| 14 #include "chrome/browser/defaults.h" |
14 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 15 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
15 #include "chrome/browser/dom_ui/downloads_dom_handler.h" | 16 #include "chrome/browser/dom_ui/downloads_dom_handler.h" |
16 #include "chrome/browser/download/download_manager.h" | 17 #include "chrome/browser/download/download_manager.h" |
17 #include "chrome/browser/profile.h" | 18 #include "chrome/browser/profile.h" |
18 #include "chrome/common/jstemplate_builder.h" | 19 #include "chrome/common/jstemplate_builder.h" |
19 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
20 #include "grit/browser_resources.h" | 21 #include "grit/browser_resources.h" |
21 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
22 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
23 | 24 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 localized_strings.SetString(L"danger_desc", | 79 localized_strings.SetString(L"danger_desc", |
79 l10n_util::GetStringF(IDS_PROMPT_DANGEROUS_DOWNLOAD, L"%s")); | 80 l10n_util::GetStringF(IDS_PROMPT_DANGEROUS_DOWNLOAD, L"%s")); |
80 localized_strings.SetString(L"danger_save", | 81 localized_strings.SetString(L"danger_save", |
81 l10n_util::GetString(IDS_SAVE_DOWNLOAD)); | 82 l10n_util::GetString(IDS_SAVE_DOWNLOAD)); |
82 localized_strings.SetString(L"danger_discard", | 83 localized_strings.SetString(L"danger_discard", |
83 l10n_util::GetString(IDS_DISCARD_DOWNLOAD)); | 84 l10n_util::GetString(IDS_DISCARD_DOWNLOAD)); |
84 | 85 |
85 // Controls. | 86 // Controls. |
86 localized_strings.SetString(L"control_pause", | 87 localized_strings.SetString(L"control_pause", |
87 l10n_util::GetString(IDS_DOWNLOAD_LINK_PAUSE)); | 88 l10n_util::GetString(IDS_DOWNLOAD_LINK_PAUSE)); |
88 localized_strings.SetString(L"control_showinfolder", | 89 if (browser_defaults::kDownloadPageHasShowInFolder) { |
89 l10n_util::GetString(IDS_DOWNLOAD_LINK_SHOW)); | 90 localized_strings.SetString(L"control_showinfolder", |
| 91 l10n_util::GetString(IDS_DOWNLOAD_LINK_SHOW)); |
| 92 } |
90 localized_strings.SetString(L"control_cancel", | 93 localized_strings.SetString(L"control_cancel", |
91 l10n_util::GetString(IDS_DOWNLOAD_LINK_CANCEL)); | 94 l10n_util::GetString(IDS_DOWNLOAD_LINK_CANCEL)); |
92 localized_strings.SetString(L"control_resume", | 95 localized_strings.SetString(L"control_resume", |
93 l10n_util::GetString(IDS_DOWNLOAD_LINK_RESUME)); | 96 l10n_util::GetString(IDS_DOWNLOAD_LINK_RESUME)); |
94 localized_strings.SetString(L"control_removefromlist", | 97 localized_strings.SetString(L"control_removefromlist", |
95 l10n_util::GetString(IDS_DOWNLOAD_LINK_REMOVE)); | 98 l10n_util::GetString(IDS_DOWNLOAD_LINK_REMOVE)); |
96 | 99 |
97 SetFontAndTextDirection(&localized_strings); | 100 SetFontAndTextDirection(&localized_strings); |
98 | 101 |
99 static const base::StringPiece downloads_html( | 102 static const base::StringPiece downloads_html( |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 NewRunnableMethod(Singleton<ChromeURLDataManager>::get(), | 137 NewRunnableMethod(Singleton<ChromeURLDataManager>::get(), |
135 &ChromeURLDataManager::AddDataSource, | 138 &ChromeURLDataManager::AddDataSource, |
136 make_scoped_refptr(html_source))); | 139 make_scoped_refptr(html_source))); |
137 } | 140 } |
138 | 141 |
139 // static | 142 // static |
140 RefCountedMemory* DownloadsUI::GetFaviconResourceBytes() { | 143 RefCountedMemory* DownloadsUI::GetFaviconResourceBytes() { |
141 return ResourceBundle::GetSharedInstance(). | 144 return ResourceBundle::GetSharedInstance(). |
142 LoadDataResourceBytes(IDR_DOWNLOADS_FAVICON); | 145 LoadDataResourceBytes(IDR_DOWNLOADS_FAVICON); |
143 } | 146 } |
OLD | NEW |