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

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 fe29a532d90222a7bfd126ae6ae40e585dd57a00..7dbc67db5853c4922e20ad173c49ec017f282e56 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());
is_error_page_ = true;
@@ -108,13 +108,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