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/md_downloads/md_downloads_ui.h" | 5 #include "chrome/browser/ui/webui/md_downloads/md_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 source->AddLocalizedString("inIncognito", IDS_DOWNLOAD_IN_INCOGNITO); | 95 source->AddLocalizedString("inIncognito", IDS_DOWNLOAD_IN_INCOGNITO); |
96 | 96 |
97 source->AddResourcePath("1x/incognito_marker.png", | 97 source->AddResourcePath("1x/incognito_marker.png", |
98 IDR_MD_DOWNLOADS_1X_INCOGNITO_MARKER_PNG); | 98 IDR_MD_DOWNLOADS_1X_INCOGNITO_MARKER_PNG); |
99 source->AddResourcePath("2x/incognito_marker.png", | 99 source->AddResourcePath("2x/incognito_marker.png", |
100 IDR_MD_DOWNLOADS_2X_INCOGNITO_MARKER_PNG); | 100 IDR_MD_DOWNLOADS_2X_INCOGNITO_MARKER_PNG); |
101 source->AddResourcePath("1x/no_downloads.png", | 101 source->AddResourcePath("1x/no_downloads.png", |
102 IDR_MD_DOWNLOADS_1X_NO_DOWNLOADS_PNG); | 102 IDR_MD_DOWNLOADS_1X_NO_DOWNLOADS_PNG); |
103 source->AddResourcePath("2x/no_downloads.png", | 103 source->AddResourcePath("2x/no_downloads.png", |
104 IDR_MD_DOWNLOADS_2X_NO_DOWNLOADS_PNG); | 104 IDR_MD_DOWNLOADS_2X_NO_DOWNLOADS_PNG); |
| 105 |
| 106 #if defined(USE_VULCANIZE) |
| 107 source->AddResourcePath("crisper.js", IDR_MD_DOWNLOADS_CRISPER_JS); |
| 108 source->SetDefaultResource(IDR_MD_DOWNLOADS_VULCANIZED_HTML); |
| 109 #else |
105 source->AddResourcePath("action_service.html", | 110 source->AddResourcePath("action_service.html", |
106 IDR_MD_DOWNLOADS_ACTION_SERVICE_HTML); | 111 IDR_MD_DOWNLOADS_ACTION_SERVICE_HTML); |
107 source->AddResourcePath("action_service.js", | 112 source->AddResourcePath("action_service.js", |
108 IDR_MD_DOWNLOADS_ACTION_SERVICE_JS); | 113 IDR_MD_DOWNLOADS_ACTION_SERVICE_JS); |
109 source->AddResourcePath("constants.html", IDR_MD_DOWNLOADS_CONSTANTS_HTML); | 114 source->AddResourcePath("constants.html", IDR_MD_DOWNLOADS_CONSTANTS_HTML); |
110 source->AddResourcePath("constants.js", IDR_MD_DOWNLOADS_CONSTANTS_JS); | 115 source->AddResourcePath("constants.js", IDR_MD_DOWNLOADS_CONSTANTS_JS); |
111 source->AddResourcePath("crisper.js", IDR_MD_DOWNLOADS_CRISPER_JS); | |
112 source->AddResourcePath("dev.html", IDR_MD_DOWNLOADS_DOWNLOADS_HTML); | |
113 source->AddResourcePath("downloads.js", IDR_MD_DOWNLOADS_DOWNLOADS_JS); | 116 source->AddResourcePath("downloads.js", IDR_MD_DOWNLOADS_DOWNLOADS_JS); |
114 source->AddResourcePath("i18n_setup.html", IDR_MD_DOWNLOADS_I18N_SETUP_HTML); | 117 source->AddResourcePath("i18n_setup.html", IDR_MD_DOWNLOADS_I18N_SETUP_HTML); |
115 source->AddResourcePath("item.css", IDR_MD_DOWNLOADS_ITEM_CSS); | 118 source->AddResourcePath("item.css", IDR_MD_DOWNLOADS_ITEM_CSS); |
116 source->AddResourcePath("item.html", IDR_MD_DOWNLOADS_ITEM_HTML); | 119 source->AddResourcePath("item.html", IDR_MD_DOWNLOADS_ITEM_HTML); |
117 source->AddResourcePath("item.js", IDR_MD_DOWNLOADS_ITEM_JS); | 120 source->AddResourcePath("item.js", IDR_MD_DOWNLOADS_ITEM_JS); |
118 source->AddResourcePath("manager.css", IDR_MD_DOWNLOADS_MANAGER_CSS); | 121 source->AddResourcePath("manager.css", IDR_MD_DOWNLOADS_MANAGER_CSS); |
119 source->AddResourcePath("manager.html", IDR_MD_DOWNLOADS_MANAGER_HTML); | 122 source->AddResourcePath("manager.html", IDR_MD_DOWNLOADS_MANAGER_HTML); |
120 source->AddResourcePath("manager.js", IDR_MD_DOWNLOADS_MANAGER_JS); | 123 source->AddResourcePath("manager.js", IDR_MD_DOWNLOADS_MANAGER_JS); |
121 source->AddResourcePath("shared_style.css", | 124 source->AddResourcePath("shared_style.css", |
122 IDR_MD_DOWNLOADS_SHARED_STYLE_CSS); | 125 IDR_MD_DOWNLOADS_SHARED_STYLE_CSS); |
123 source->AddResourcePath("toolbar.css", IDR_MD_DOWNLOADS_TOOLBAR_CSS); | 126 source->AddResourcePath("toolbar.css", IDR_MD_DOWNLOADS_TOOLBAR_CSS); |
124 source->AddResourcePath("toolbar.html", IDR_MD_DOWNLOADS_TOOLBAR_HTML); | 127 source->AddResourcePath("toolbar.html", IDR_MD_DOWNLOADS_TOOLBAR_HTML); |
125 source->AddResourcePath("toolbar.js", IDR_MD_DOWNLOADS_TOOLBAR_JS); | 128 source->AddResourcePath("toolbar.js", IDR_MD_DOWNLOADS_TOOLBAR_JS); |
| 129 source->SetDefaultResource(IDR_MD_DOWNLOADS_DOWNLOADS_HTML); |
| 130 #endif |
126 | 131 |
127 source->SetDefaultResource(IDR_MD_DOWNLOADS_VULCANIZED_HTML); | |
128 source->SetJsonPath("strings.js"); | 132 source->SetJsonPath("strings.js"); |
129 | 133 |
130 return source; | 134 return source; |
131 } | 135 } |
132 | 136 |
133 } // namespace | 137 } // namespace |
134 | 138 |
135 /////////////////////////////////////////////////////////////////////////////// | 139 /////////////////////////////////////////////////////////////////////////////// |
136 // | 140 // |
137 // MdDownloadsUI | 141 // MdDownloadsUI |
(...skipping 20 matching lines...) Expand all Loading... |
158 base::RefCountedMemory* MdDownloadsUI::GetFaviconResourceBytes( | 162 base::RefCountedMemory* MdDownloadsUI::GetFaviconResourceBytes( |
159 ui::ScaleFactor scale_factor) { | 163 ui::ScaleFactor scale_factor) { |
160 return ResourceBundle::GetSharedInstance(). | 164 return ResourceBundle::GetSharedInstance(). |
161 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); | 165 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); |
162 } | 166 } |
163 | 167 |
164 void MdDownloadsUI::RenderViewReused( | 168 void MdDownloadsUI::RenderViewReused( |
165 content::RenderViewHost* render_view_host) { | 169 content::RenderViewHost* render_view_host) { |
166 handler_->RenderViewReused(render_view_host); | 170 handler_->RenderViewReused(render_view_host); |
167 } | 171 } |
OLD | NEW |