| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/downloads_ui.h" | 5 #include "chrome/browser/ui/webui/downloads_ui.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted_memory.h" | 7 #include "base/memory/ref_counted_memory.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 if (MdDownloadsEnabled()) { | 95 if (MdDownloadsEnabled()) { |
| 96 source->AddLocalizedString("clearSearch", IDS_DOWNLOAD_CLEAR_SEARCH); | 96 source->AddLocalizedString("clearSearch", IDS_DOWNLOAD_CLEAR_SEARCH); |
| 97 source->AddLocalizedString("controlRetry", IDS_MD_DOWNLOAD_LINK_RETRY); | 97 source->AddLocalizedString("controlRetry", IDS_MD_DOWNLOAD_LINK_RETRY); |
| 98 source->AddLocalizedString("controlledByUrl", | 98 source->AddLocalizedString("controlledByUrl", |
| 99 IDS_DOWNLOAD_BY_EXTENSION_URL); | 99 IDS_DOWNLOAD_BY_EXTENSION_URL); |
| 100 source->AddLocalizedString("inIncognito", IDS_DOWNLOAD_IN_INCOGNITO); | 100 source->AddLocalizedString("inIncognito", IDS_DOWNLOAD_IN_INCOGNITO); |
| 101 source->AddLocalizedString("moreActions", IDS_DOWNLOAD_MORE_ACTIONS); | 101 source->AddLocalizedString("moreActions", IDS_DOWNLOAD_MORE_ACTIONS); |
| 102 source->AddLocalizedString("noDownloads", IDS_MD_DOWNLOAD_NO_DOWNLOADS); | 102 source->AddLocalizedString("noDownloads", IDS_MD_DOWNLOAD_NO_DOWNLOADS); |
| 103 source->AddLocalizedString("search", IDS_MD_DOWNLOAD_SEARCH); | 103 source->AddLocalizedString("search", IDS_MD_DOWNLOAD_SEARCH); |
| 104 | 104 |
| 105 source->AddResourcePath("1x/incognito_marker.png", |
| 106 IDR_MD_DOWNLOADS_1X_INCOGNITO_MARKER_PNG); |
| 107 source->AddResourcePath("2x/incognito_marker.png", |
| 108 IDR_MD_DOWNLOADS_2X_INCOGNITO_MARKER_PNG); |
| 109 source->AddResourcePath("1x/no_downloads.png", |
| 110 IDR_MD_DOWNLOADS_1X_NO_DOWNLOADS_PNG); |
| 111 source->AddResourcePath("2x/no_downloads.png", |
| 112 IDR_MD_DOWNLOADS_2X_NO_DOWNLOADS_PNG); |
| 105 source->AddResourcePath("action_service.html", | 113 source->AddResourcePath("action_service.html", |
| 106 IDR_MD_DOWNLOADS_ACTION_SERVICE_HTML); | 114 IDR_MD_DOWNLOADS_ACTION_SERVICE_HTML); |
| 107 source->AddResourcePath("action_service.js", | 115 source->AddResourcePath("action_service.js", |
| 108 IDR_MD_DOWNLOADS_ACTION_SERVICE_JS); | 116 IDR_MD_DOWNLOADS_ACTION_SERVICE_JS); |
| 117 source->AddResourcePath("crisper.js", IDR_MD_DOWNLOADS_CRISPER_JS); |
| 118 source->AddResourcePath("dev.html", IDR_MD_DOWNLOADS_DOWNLOADS_HTML); |
| 109 source->AddResourcePath("focus_row.html", IDR_MD_DOWNLOADS_FOCUS_ROW_HTML); | 119 source->AddResourcePath("focus_row.html", IDR_MD_DOWNLOADS_FOCUS_ROW_HTML); |
| 110 source->AddResourcePath("focus_row.js", IDR_MD_DOWNLOADS_FOCUS_ROW_JS); | 120 source->AddResourcePath("focus_row.js", IDR_MD_DOWNLOADS_FOCUS_ROW_JS); |
| 111 source->AddResourcePath("item.css", IDR_MD_DOWNLOADS_ITEM_CSS); | 121 source->AddResourcePath("item.css", IDR_MD_DOWNLOADS_ITEM_CSS); |
| 112 source->AddResourcePath("item.html", IDR_MD_DOWNLOADS_ITEM_HTML); | 122 source->AddResourcePath("item.html", IDR_MD_DOWNLOADS_ITEM_HTML); |
| 113 source->AddResourcePath("item.js", IDR_MD_DOWNLOADS_ITEM_JS); | 123 source->AddResourcePath("item.js", IDR_MD_DOWNLOADS_ITEM_JS); |
| 114 source->AddResourcePath("manager.css", IDR_MD_DOWNLOADS_MANAGER_CSS); | 124 source->AddResourcePath("manager.css", IDR_MD_DOWNLOADS_MANAGER_CSS); |
| 115 source->AddResourcePath("manager.html", IDR_MD_DOWNLOADS_MANAGER_HTML); | 125 source->AddResourcePath("manager.html", IDR_MD_DOWNLOADS_MANAGER_HTML); |
| 116 source->AddResourcePath("manager.js", IDR_MD_DOWNLOADS_MANAGER_JS); | 126 source->AddResourcePath("manager.js", IDR_MD_DOWNLOADS_MANAGER_JS); |
| 117 source->AddResourcePath("shared_style.css", | 127 source->AddResourcePath("shared_style.css", |
| 118 IDR_MD_DOWNLOADS_SHARED_STYLE_CSS); | 128 IDR_MD_DOWNLOADS_SHARED_STYLE_CSS); |
| 119 source->AddResourcePath("strings.html", IDR_MD_DOWNLOADS_STRINGS_HTML); | 129 source->AddResourcePath("strings.html", IDR_MD_DOWNLOADS_STRINGS_HTML); |
| 120 source->AddResourcePath("toolbar.css", IDR_MD_DOWNLOADS_TOOLBAR_CSS); | 130 source->AddResourcePath("toolbar.css", IDR_MD_DOWNLOADS_TOOLBAR_CSS); |
| 121 source->AddResourcePath("toolbar.html", IDR_MD_DOWNLOADS_TOOLBAR_HTML); | 131 source->AddResourcePath("toolbar.html", IDR_MD_DOWNLOADS_TOOLBAR_HTML); |
| 122 source->AddResourcePath("toolbar.js", IDR_MD_DOWNLOADS_TOOLBAR_JS); | 132 source->AddResourcePath("toolbar.js", IDR_MD_DOWNLOADS_TOOLBAR_JS); |
| 123 source->SetDefaultResource(IDR_MD_DOWNLOADS_DOWNLOADS_HTML); | 133 source->SetDefaultResource(IDR_MD_DOWNLOADS_VULCANIZED_HTML); |
| 124 } else { | 134 } else { |
| 125 source->AddLocalizedString("controlRetry", IDS_DOWNLOAD_LINK_RETRY); | 135 source->AddLocalizedString("controlRetry", IDS_DOWNLOAD_LINK_RETRY); |
| 126 source->AddLocalizedString("controlByExtension", | 136 source->AddLocalizedString("controlByExtension", |
| 127 IDS_DOWNLOAD_BY_EXTENSION); | 137 IDS_DOWNLOAD_BY_EXTENSION); |
| 128 source->AddLocalizedString("noDownloads", IDS_DOWNLOAD_NO_DOWNLOADS); | 138 source->AddLocalizedString("noDownloads", IDS_DOWNLOAD_NO_DOWNLOADS); |
| 129 source->AddLocalizedString("searchButton", IDS_DOWNLOAD_SEARCH_BUTTON); | 139 source->AddLocalizedString("searchButton", IDS_DOWNLOAD_SEARCH_BUTTON); |
| 130 | 140 |
| 131 source->AddResourcePath("item_view.js", IDR_DOWNLOADS_ITEM_VIEW_JS); | 141 source->AddResourcePath("item_view.js", IDR_DOWNLOADS_ITEM_VIEW_JS); |
| 132 source->AddResourcePath("focus_row.js", IDR_DOWNLOADS_FOCUS_ROW_JS); | 142 source->AddResourcePath("focus_row.js", IDR_DOWNLOADS_FOCUS_ROW_JS); |
| 133 source->AddResourcePath("manager.js", IDR_DOWNLOADS_MANAGER_JS); | 143 source->AddResourcePath("manager.js", IDR_DOWNLOADS_MANAGER_JS); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 160 content::URLDataSource::Add(profile, theme); | 170 content::URLDataSource::Add(profile, theme); |
| 161 #endif | 171 #endif |
| 162 } | 172 } |
| 163 | 173 |
| 164 // static | 174 // static |
| 165 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes( | 175 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes( |
| 166 ui::ScaleFactor scale_factor) { | 176 ui::ScaleFactor scale_factor) { |
| 167 return ResourceBundle::GetSharedInstance(). | 177 return ResourceBundle::GetSharedInstance(). |
| 168 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); | 178 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); |
| 169 } | 179 } |
| OLD | NEW |