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

Unified Diff: components/dom_distiller/core/dom_distiller_request_view_base.cc

Issue 1225183002: Font size in DomDistiller prefs syncs with local scaling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge master again Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/core/dom_distiller_request_view_base.cc
diff --git a/components/dom_distiller/core/dom_distiller_request_view_base.cc b/components/dom_distiller/core/dom_distiller_request_view_base.cc
index 70e7185ab0fe78a85bd2d8fc0919f899cccbb90b..911cfdd91dbc584bfaf8908f7f0ed81ac1a89a2e 100644
--- a/components/dom_distiller/core/dom_distiller_request_view_base.cc
+++ b/components/dom_distiller/core/dom_distiller_request_view_base.cc
@@ -32,7 +32,7 @@ DomDistillerRequestViewBase::~DomDistillerRequestViewBase() {
void DomDistillerRequestViewBase::FlagAsErrorPage() {
// Viewer handle is not passed to this in the case of error pages
// so send all JavaScript now.
- SendJavaScript(viewer::GetJavaScript());
+ SendCommonJavaScript();
SendJavaScript(viewer::GetErrorPageJs());
std::string title(l10n_util::GetStringUTF8(
@@ -114,13 +114,23 @@ void DomDistillerRequestViewBase::OnChangeFontFamily(
SendJavaScript(viewer::GetDistilledPageFontFamilyJs(new_font));
}
+void DomDistillerRequestViewBase::OnChangeFontScaling(float scaling) {
+ SendJavaScript(viewer::GetDistilledPageFontScalingJs(scaling));
+}
+
void DomDistillerRequestViewBase::TakeViewerHandle(
scoped_ptr<ViewerHandle> viewer_handle) {
viewer_handle_ = viewer_handle.Pass();
// Getting the viewer handle means this is not an error page, send
// the viewer JavaScript and show the loading indicator.
- SendJavaScript(viewer::GetJavaScript());
+ SendCommonJavaScript();
SendJavaScript(viewer::GetToggleLoadingIndicatorJs(false));
}
+void DomDistillerRequestViewBase::SendCommonJavaScript() {
+ SendJavaScript(viewer::GetJavaScript());
+ SendJavaScript(viewer::GetDistilledPageFontScalingJs(
+ distilled_page_prefs_->GetFontScaling()));
+}
+
} // namespace dom_distiller

Powered by Google App Engine
This is Rietveld 408576698