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

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

Issue 2264983002: MD History: Lazily load element files which are not needed for first paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor tweaks and rebase Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_history_ui.h" 5 #include "chrome/browser/ui/webui/md_history_ui.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/signin_manager_factory.h" 10 #include "chrome/browser/signin/signin_manager_factory.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_PNG); 127 IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_PNG);
128 source->AddResourcePath("images/200/sign_in_promo.png", 128 source->AddResourcePath("images/200/sign_in_promo.png",
129 IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_PNG); 129 IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_PNG);
130 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS); 130 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS);
131 131
132 #if BUILDFLAG(USE_VULCANIZE) 132 #if BUILDFLAG(USE_VULCANIZE)
133 source->AddResourcePath("app.html", 133 source->AddResourcePath("app.html",
134 IDR_MD_HISTORY_APP_VULCANIZED_HTML); 134 IDR_MD_HISTORY_APP_VULCANIZED_HTML);
135 source->AddResourcePath("app.crisper.js", 135 source->AddResourcePath("app.crisper.js",
136 IDR_MD_HISTORY_APP_CRISPER_JS); 136 IDR_MD_HISTORY_APP_CRISPER_JS);
137 source->AddResourcePath("lazy_load.html",
138 IDR_MD_HISTORY_LAZY_LOAD_VULCANIZED_HTML);
139 source->AddResourcePath("lazy_load.crisper.js",
140 IDR_MD_HISTORY_LAZY_LOAD_CRISPER_JS);
137 #else 141 #else
138 source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML); 142 source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML);
139 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS); 143 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS);
140 source->AddResourcePath("browser_service.html", 144 source->AddResourcePath("browser_service.html",
141 IDR_MD_HISTORY_BROWSER_SERVICE_HTML); 145 IDR_MD_HISTORY_BROWSER_SERVICE_HTML);
142 source->AddResourcePath("browser_service.js", 146 source->AddResourcePath("browser_service.js",
143 IDR_MD_HISTORY_BROWSER_SERVICE_JS); 147 IDR_MD_HISTORY_BROWSER_SERVICE_JS);
144 source->AddResourcePath("grouped_list.html", 148 source->AddResourcePath("grouped_list.html",
145 IDR_MD_HISTORY_GROUPED_LIST_HTML); 149 IDR_MD_HISTORY_GROUPED_LIST_HTML);
146 source->AddResourcePath("grouped_list.js", IDR_MD_HISTORY_GROUPED_LIST_JS); 150 source->AddResourcePath("grouped_list.js", IDR_MD_HISTORY_GROUPED_LIST_JS);
147 source->AddResourcePath("history_item.html", 151 source->AddResourcePath("history_item.html",
148 IDR_MD_HISTORY_HISTORY_ITEM_HTML); 152 IDR_MD_HISTORY_HISTORY_ITEM_HTML);
149 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); 153 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS);
150 source->AddResourcePath("history_list.html", 154 source->AddResourcePath("history_list.html",
151 IDR_MD_HISTORY_HISTORY_LIST_HTML); 155 IDR_MD_HISTORY_HISTORY_LIST_HTML);
152 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS); 156 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS);
153 source->AddResourcePath("history_list_behavior.html", 157 source->AddResourcePath("history_list_behavior.html",
154 IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_HTML); 158 IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_HTML);
155 source->AddResourcePath("history_list_behavior.js", 159 source->AddResourcePath("history_list_behavior.js",
156 IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_JS); 160 IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_JS);
157 source->AddResourcePath("history_toolbar.html", 161 source->AddResourcePath("history_toolbar.html",
158 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); 162 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML);
159 source->AddResourcePath("history_toolbar.js", 163 source->AddResourcePath("history_toolbar.js",
160 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); 164 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS);
161 source->AddResourcePath("icons.html", IDR_MD_HISTORY_ICONS_HTML); 165 source->AddResourcePath("icons.html", IDR_MD_HISTORY_ICONS_HTML);
166 source->AddResourcePath("lazy_load.html", IDR_MD_HISTORY_LAZY_LOAD_HTML);
162 source->AddResourcePath("list_container.html", 167 source->AddResourcePath("list_container.html",
163 IDR_MD_HISTORY_LIST_CONTAINER_HTML); 168 IDR_MD_HISTORY_LIST_CONTAINER_HTML);
164 source->AddResourcePath("list_container.js", 169 source->AddResourcePath("list_container.js",
165 IDR_MD_HISTORY_LIST_CONTAINER_JS); 170 IDR_MD_HISTORY_LIST_CONTAINER_JS);
166 source->AddResourcePath("searched_label.html", 171 source->AddResourcePath("searched_label.html",
167 IDR_MD_HISTORY_SEARCHED_LABEL_HTML); 172 IDR_MD_HISTORY_SEARCHED_LABEL_HTML);
168 source->AddResourcePath("searched_label.js", 173 source->AddResourcePath("searched_label.js",
169 IDR_MD_HISTORY_SEARCHED_LABEL_JS); 174 IDR_MD_HISTORY_SEARCHED_LABEL_JS);
170 source->AddResourcePath("shared_style.html", 175 source->AddResourcePath("shared_style.html",
171 IDR_MD_HISTORY_SHARED_STYLE_HTML); 176 IDR_MD_HISTORY_SHARED_STYLE_HTML);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 base::FeatureList::ClearInstanceForTesting(); 229 base::FeatureList::ClearInstanceForTesting();
225 base::FeatureList::SetInstance(std::move(feature_list)); 230 base::FeatureList::SetInstance(std::move(feature_list));
226 } 231 }
227 232
228 // static 233 // static
229 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( 234 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes(
230 ui::ScaleFactor scale_factor) { 235 ui::ScaleFactor scale_factor) {
231 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( 236 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
232 IDR_HISTORY_FAVICON, scale_factor); 237 IDR_HISTORY_FAVICON, scale_factor);
233 } 238 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698