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

Unified Diff: chrome/browser/ui/webui/options/options_ui.cc

Issue 747923004: webui: minimize webui flicker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/options_ui.cc
diff --git a/chrome/browser/ui/webui/options/options_ui.cc b/chrome/browser/ui/webui/options/options_ui.cc
index cd5a3e1f343d84702dabbfe638b967faee0a9bbe..b0fe288fab51b6018d1d8e5abbaa9053542f3a61 100644
--- a/chrome/browser/ui/webui/options/options_ui.cc
+++ b/chrome/browser/ui/webui/options/options_ui.cc
@@ -179,9 +179,11 @@ void OptionsUIHTMLSource::StartDataRequest(
response_bytes = ui::ResourceBundle::GetSharedInstance().
LoadDataResourceBytes(IDR_OPTIONS_BUNDLE_JS);
} else {
- // Return (and cache) the main options html page as the default.
- response_bytes = ui::ResourceBundle::GetSharedInstance().
- LoadDataResourceBytes(IDR_OPTIONS_HTML);
+ // Return the main options html page as the default.
+ std::string html_page = webui::ReplaceFontFamilyAndSize(
+ ui::ResourceBundle::GetSharedInstance().
+ GetRawDataResource(IDR_OPTIONS_HTML).as_string());
Dan Beam 2014/11/22 04:27:12 this probably makes more copies than I'd like, but
+ response_bytes = base::RefCountedString::TakeString(&html_page);
}
callback.Run(response_bytes.get());

Powered by Google App Engine
This is Rietveld 408576698