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

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: Remove flattenhtml, rebase Created 4 years, 2 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/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_PNG); 134 IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_PNG);
135 source->AddResourcePath("images/200/sign_in_promo.png", 135 source->AddResourcePath("images/200/sign_in_promo.png",
136 IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_PNG); 136 IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_PNG);
137 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS); 137 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS);
138 138
139 #if BUILDFLAG(USE_VULCANIZE) 139 #if BUILDFLAG(USE_VULCANIZE)
140 source->AddResourcePath("app.html", 140 source->AddResourcePath("app.html",
141 IDR_MD_HISTORY_APP_VULCANIZED_HTML); 141 IDR_MD_HISTORY_APP_VULCANIZED_HTML);
142 source->AddResourcePath("app.crisper.js", 142 source->AddResourcePath("app.crisper.js",
143 IDR_MD_HISTORY_APP_CRISPER_JS); 143 IDR_MD_HISTORY_APP_CRISPER_JS);
144 source->AddResourcePath("lazy_load.html",
145 IDR_MD_HISTORY_LAZY_LOAD_VULCANIZED_HTML);
146 source->AddResourcePath("lazy_load.crisper.js",
147 IDR_MD_HISTORY_LAZY_LOAD_CRISPER_JS);
144 #else 148 #else
145 source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML); 149 source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML);
146 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS); 150 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS);
147 source->AddResourcePath("browser_service.html", 151 source->AddResourcePath("browser_service.html",
148 IDR_MD_HISTORY_BROWSER_SERVICE_HTML); 152 IDR_MD_HISTORY_BROWSER_SERVICE_HTML);
149 source->AddResourcePath("browser_service.js", 153 source->AddResourcePath("browser_service.js",
150 IDR_MD_HISTORY_BROWSER_SERVICE_JS); 154 IDR_MD_HISTORY_BROWSER_SERVICE_JS);
151 source->AddResourcePath("grouped_list.html", 155 source->AddResourcePath("grouped_list.html",
152 IDR_MD_HISTORY_GROUPED_LIST_HTML); 156 IDR_MD_HISTORY_GROUPED_LIST_HTML);
153 source->AddResourcePath("grouped_list.js", IDR_MD_HISTORY_GROUPED_LIST_JS); 157 source->AddResourcePath("grouped_list.js", IDR_MD_HISTORY_GROUPED_LIST_JS);
154 source->AddResourcePath("history_item.html", 158 source->AddResourcePath("history_item.html",
155 IDR_MD_HISTORY_HISTORY_ITEM_HTML); 159 IDR_MD_HISTORY_HISTORY_ITEM_HTML);
156 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); 160 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS);
157 source->AddResourcePath("history_list.html", 161 source->AddResourcePath("history_list.html",
158 IDR_MD_HISTORY_HISTORY_LIST_HTML); 162 IDR_MD_HISTORY_HISTORY_LIST_HTML);
159 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS); 163 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS);
160 source->AddResourcePath("history_list_behavior.html", 164 source->AddResourcePath("history_list_behavior.html",
161 IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_HTML); 165 IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_HTML);
162 source->AddResourcePath("history_list_behavior.js", 166 source->AddResourcePath("history_list_behavior.js",
163 IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_JS); 167 IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_JS);
164 source->AddResourcePath("history_toolbar.html", 168 source->AddResourcePath("history_toolbar.html",
165 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); 169 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML);
166 source->AddResourcePath("history_toolbar.js", 170 source->AddResourcePath("history_toolbar.js",
167 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); 171 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS);
168 source->AddResourcePath("icons.html", IDR_MD_HISTORY_ICONS_HTML); 172 source->AddResourcePath("icons.html", IDR_MD_HISTORY_ICONS_HTML);
173 source->AddResourcePath("lazy_load.html", IDR_MD_HISTORY_LAZY_LOAD_HTML);
169 source->AddResourcePath("list_container.html", 174 source->AddResourcePath("list_container.html",
170 IDR_MD_HISTORY_LIST_CONTAINER_HTML); 175 IDR_MD_HISTORY_LIST_CONTAINER_HTML);
171 source->AddResourcePath("list_container.js", 176 source->AddResourcePath("list_container.js",
172 IDR_MD_HISTORY_LIST_CONTAINER_JS); 177 IDR_MD_HISTORY_LIST_CONTAINER_JS);
173 source->AddResourcePath("searched_label.html", 178 source->AddResourcePath("searched_label.html",
174 IDR_MD_HISTORY_SEARCHED_LABEL_HTML); 179 IDR_MD_HISTORY_SEARCHED_LABEL_HTML);
175 source->AddResourcePath("searched_label.js", 180 source->AddResourcePath("searched_label.js",
176 IDR_MD_HISTORY_SEARCHED_LABEL_JS); 181 IDR_MD_HISTORY_SEARCHED_LABEL_JS);
177 source->AddResourcePath("shared_style.html", 182 source->AddResourcePath("shared_style.html",
178 IDR_MD_HISTORY_SHARED_STYLE_HTML); 183 IDR_MD_HISTORY_SHARED_STYLE_HTML);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 user_prefs::PrefRegistrySyncable* registry) { 252 user_prefs::PrefRegistrySyncable* registry) {
248 registry->RegisterBooleanPref(prefs::kMdHistoryMenuPromoShown, false, 253 registry->RegisterBooleanPref(prefs::kMdHistoryMenuPromoShown, false,
249 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 254 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
250 } 255 }
251 256
252 void MdHistoryUI::HandleMenuPromoShown(const base::ListValue* args) { 257 void MdHistoryUI::HandleMenuPromoShown(const base::ListValue* args) {
253 Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean( 258 Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean(
254 prefs::kMdHistoryMenuPromoShown, true); 259 prefs::kMdHistoryMenuPromoShown, true);
255 data_source_->AddBoolean("showMenuPromo", false); 260 data_source_->AddBoolean("showMenuPromo", false);
256 } 261 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/vulcanize.py ('k') | chrome/test/data/webui/md_history/history_grouped_list_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698