Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: chrome/browser/ui/webui/downloads_ui.cc

Issue 1240853002: Slice MD downloads into more components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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("action_service.html",
101 IDR_MD_DOWNLOADS_ACTION_SERVICE_HTML);
102 source->AddResourcePath("action_service.js",
103 IDR_MD_DOWNLOADS_ACTION_SERVICE_JS);
100 source->AddResourcePath("downloads.css", IDR_MD_DOWNLOADS_DOWNLOADS_CSS); 104 source->AddResourcePath("downloads.css", IDR_MD_DOWNLOADS_DOWNLOADS_CSS);
105 source->AddResourcePath("item_view.css", IDR_MD_DOWNLOADS_ITEM_VIEW_CSS);
101 source->AddResourcePath("item_view.html", IDR_MD_DOWNLOADS_ITEM_VIEW_HTML); 106 source->AddResourcePath("item_view.html", IDR_MD_DOWNLOADS_ITEM_VIEW_HTML);
102 source->AddResourcePath("item_view.js", IDR_MD_DOWNLOADS_ITEM_VIEW_JS); 107 source->AddResourcePath("item_view.js", IDR_MD_DOWNLOADS_ITEM_VIEW_JS);
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);
105 source->AddResourcePath("strings.html", IDR_MD_DOWNLOADS_STRINGS_HTML); 110 source->AddResourcePath("strings.html", IDR_MD_DOWNLOADS_STRINGS_HTML);
111 source->AddResourcePath("toolbar.css", IDR_MD_DOWNLOADS_TOOLBAR_CSS);
112 source->AddResourcePath("toolbar.html", IDR_MD_DOWNLOADS_TOOLBAR_HTML);
113 source->AddResourcePath("toolbar.js", IDR_MD_DOWNLOADS_TOOLBAR_JS);
106 source->SetDefaultResource(IDR_MD_DOWNLOADS_DOWNLOADS_HTML); 114 source->SetDefaultResource(IDR_MD_DOWNLOADS_DOWNLOADS_HTML);
107 } else { 115 } else {
108 source->AddResourcePath("item_view.js", IDR_DOWNLOADS_ITEM_VIEW_JS); 116 source->AddResourcePath("item_view.js", IDR_DOWNLOADS_ITEM_VIEW_JS);
109 source->AddResourcePath("focus_row.js", IDR_DOWNLOADS_FOCUS_ROW_JS); 117 source->AddResourcePath("focus_row.js", IDR_DOWNLOADS_FOCUS_ROW_JS);
110 source->AddResourcePath("manager.js", IDR_DOWNLOADS_MANAGER_JS); 118 source->AddResourcePath("manager.js", IDR_DOWNLOADS_MANAGER_JS);
111 source->SetDefaultResource(IDR_DOWNLOADS_DOWNLOADS_HTML); 119 source->SetDefaultResource(IDR_DOWNLOADS_DOWNLOADS_HTML);
112 } 120 }
113 121
114 return source; 122 return source;
115 } 123 }
(...skipping 21 matching lines...) Expand all
137 content::URLDataSource::Add(profile, theme); 145 content::URLDataSource::Add(profile, theme);
138 #endif 146 #endif
139 } 147 }
140 148
141 // static 149 // static
142 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes( 150 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes(
143 ui::ScaleFactor scale_factor) { 151 ui::ScaleFactor scale_factor) {
144 return ResourceBundle::GetSharedInstance(). 152 return ResourceBundle::GetSharedInstance().
145 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); 153 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor);
146 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698