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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 source->SetJsonPath("strings.js"); | 91 source->SetJsonPath("strings.js"); |
92 source->AddResourcePath("constants.html", IDR_DOWNLOADS_CONSTANTS_HTML); | 92 source->AddResourcePath("constants.html", IDR_DOWNLOADS_CONSTANTS_HTML); |
93 source->AddResourcePath("constants.js", IDR_DOWNLOADS_CONSTANTS_JS); | 93 source->AddResourcePath("constants.js", IDR_DOWNLOADS_CONSTANTS_JS); |
94 source->AddResourcePath("throttled_icon_loader.html", | 94 source->AddResourcePath("throttled_icon_loader.html", |
95 IDR_DOWNLOADS_THROTTLED_ICON_LOADER_HTML); | 95 IDR_DOWNLOADS_THROTTLED_ICON_LOADER_HTML); |
96 source->AddResourcePath("throttled_icon_loader.js", | 96 source->AddResourcePath("throttled_icon_loader.js", |
97 IDR_DOWNLOADS_THROTTLED_ICON_LOADER_JS); | 97 IDR_DOWNLOADS_THROTTLED_ICON_LOADER_JS); |
98 | 98 |
99 if (switches::MdDownloadsEnabled()) { | 99 if (switches::MdDownloadsEnabled()) { |
100 source->AddResourcePath("downloads.css", IDR_MD_DOWNLOADS_DOWNLOADS_CSS); | 100 source->AddResourcePath("action_service.html", |
| 101 IDR_MD_DOWNLOADS_ACTION_SERVICE_HTML); |
| 102 source->AddResourcePath("action_service.js", |
| 103 IDR_MD_DOWNLOADS_ACTION_SERVICE_JS); |
| 104 source->AddResourcePath("item_view.css", IDR_MD_DOWNLOADS_ITEM_VIEW_CSS); |
101 source->AddResourcePath("item_view.html", IDR_MD_DOWNLOADS_ITEM_VIEW_HTML); | 105 source->AddResourcePath("item_view.html", IDR_MD_DOWNLOADS_ITEM_VIEW_HTML); |
102 source->AddResourcePath("item_view.js", IDR_MD_DOWNLOADS_ITEM_VIEW_JS); | 106 source->AddResourcePath("item_view.js", IDR_MD_DOWNLOADS_ITEM_VIEW_JS); |
| 107 source->AddResourcePath("manager.css", IDR_MD_DOWNLOADS_MANAGER_CSS); |
103 source->AddResourcePath("manager.html", IDR_MD_DOWNLOADS_MANAGER_HTML); | 108 source->AddResourcePath("manager.html", IDR_MD_DOWNLOADS_MANAGER_HTML); |
104 source->AddResourcePath("manager.js", IDR_MD_DOWNLOADS_MANAGER_JS); | 109 source->AddResourcePath("manager.js", IDR_MD_DOWNLOADS_MANAGER_JS); |
| 110 source->AddResourcePath("shared_style.css", |
| 111 IDR_MD_DOWNLOADS_SHARED_STYLE_CSS); |
105 source->AddResourcePath("strings.html", IDR_MD_DOWNLOADS_STRINGS_HTML); | 112 source->AddResourcePath("strings.html", IDR_MD_DOWNLOADS_STRINGS_HTML); |
| 113 source->AddResourcePath("toolbar.css", IDR_MD_DOWNLOADS_TOOLBAR_CSS); |
| 114 source->AddResourcePath("toolbar.html", IDR_MD_DOWNLOADS_TOOLBAR_HTML); |
| 115 source->AddResourcePath("toolbar.js", IDR_MD_DOWNLOADS_TOOLBAR_JS); |
106 source->SetDefaultResource(IDR_MD_DOWNLOADS_DOWNLOADS_HTML); | 116 source->SetDefaultResource(IDR_MD_DOWNLOADS_DOWNLOADS_HTML); |
107 } else { | 117 } else { |
108 source->AddResourcePath("item_view.js", IDR_DOWNLOADS_ITEM_VIEW_JS); | 118 source->AddResourcePath("item_view.js", IDR_DOWNLOADS_ITEM_VIEW_JS); |
109 source->AddResourcePath("focus_row.js", IDR_DOWNLOADS_FOCUS_ROW_JS); | 119 source->AddResourcePath("focus_row.js", IDR_DOWNLOADS_FOCUS_ROW_JS); |
110 source->AddResourcePath("manager.js", IDR_DOWNLOADS_MANAGER_JS); | 120 source->AddResourcePath("manager.js", IDR_DOWNLOADS_MANAGER_JS); |
111 source->SetDefaultResource(IDR_DOWNLOADS_DOWNLOADS_HTML); | 121 source->SetDefaultResource(IDR_DOWNLOADS_DOWNLOADS_HTML); |
112 } | 122 } |
113 | 123 |
114 return source; | 124 return source; |
115 } | 125 } |
(...skipping 21 matching lines...) Expand all Loading... |
137 content::URLDataSource::Add(profile, theme); | 147 content::URLDataSource::Add(profile, theme); |
138 #endif | 148 #endif |
139 } | 149 } |
140 | 150 |
141 // static | 151 // static |
142 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes( | 152 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes( |
143 ui::ScaleFactor scale_factor) { | 153 ui::ScaleFactor scale_factor) { |
144 return ResourceBundle::GetSharedInstance(). | 154 return ResourceBundle::GetSharedInstance(). |
145 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); | 155 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); |
146 } | 156 } |
OLD | NEW |