Index: components/dom_distiller/content/dom_distiller_viewer_source.cc |
diff --git a/components/dom_distiller/content/dom_distiller_viewer_source.cc b/components/dom_distiller/content/dom_distiller_viewer_source.cc |
index b6b611cac83ed92551be0e8c9c0ebcb62c2d36b7..914e4f4a774bbb3d13c5201ab8817a238a5c11ca 100644 |
--- a/components/dom_distiller/content/dom_distiller_viewer_source.cc |
+++ b/components/dom_distiller/content/dom_distiller_viewer_source.cc |
@@ -12,6 +12,7 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop/message_loop.h" |
#include "base/metrics/user_metrics.h" |
+#include "base/strings/string_util.h" |
#include "base/strings/utf_string_conversions.h" |
#include "components/dom_distiller/core/distilled_page_prefs.h" |
#include "components/dom_distiller/core/dom_distiller_request_view_base.h" |
@@ -164,6 +165,8 @@ void DomDistillerViewerSource::RequestViewerHandle::DidFinishLoad( |
return; |
} |
waiting_for_page_ready_ = false; |
+ SendJavaScript(viewer::GetDistilledPageFontScalingJs( |
+ distilled_page_prefs_->GetFontScaling())); |
if (buffer_.empty()) { |
return; |
} |
@@ -226,6 +229,14 @@ void DomDistillerViewerSource::StartDataRequest( |
FeedbackReporter::ReportQuality(true); |
callback.Run(NULL); |
return; |
+ } else if (base::StartsWithASCII(path, kViewerSaveFontScalingPath, false)) { |
+ std::stringstream ss; |
+ ss << path.substr(strlen(kViewerSaveFontScalingPath)); |
cjhopman
2015/07/17 20:28:04
This should probably use base::StringToDouble.
wychen
2015/07/31 21:03:37
Done.
|
+ float scale; |
+ ss >> scale; |
+ dom_distiller_service_->GetDistilledPagePrefs()->SetFontScaling(scale); |
+ callback.Run(NULL); |
+ return; |
} |
content::WebContents* web_contents = |
content::WebContents::FromRenderFrameHost(render_frame_host); |