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

Side by Side Diff: components/dom_distiller/core/viewer.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: keep focus when useFontScaling() is called, add tests Created 5 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/dom_distiller/core/viewer.h" 5 #include "components/dom_distiller/core/viewer.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 const std::string GetDistilledPageThemeJs(DistilledPagePrefs::Theme theme) { 297 const std::string GetDistilledPageThemeJs(DistilledPagePrefs::Theme theme) {
298 return "useTheme('" + GetJsTheme(theme) + "');"; 298 return "useTheme('" + GetJsTheme(theme) + "');";
299 } 299 }
300 300
301 const std::string GetDistilledPageFontFamilyJs( 301 const std::string GetDistilledPageFontFamilyJs(
302 DistilledPagePrefs::FontFamily font_family) { 302 DistilledPagePrefs::FontFamily font_family) {
303 return "useFontFamily('" + GetJsFontFamily(font_family) + "');"; 303 return "useFontFamily('" + GetJsFontFamily(font_family) + "');";
304 } 304 }
305 305
306 const std::string GetDistilledPageFontScalingJs(
307 float scaling) {
308 std::stringstream ss;
cjhopman 2015/07/17 20:28:04 maybe: return "useFontScaling(" + base::DoubleToS
wychen 2015/07/31 21:03:37 Done.
309 ss << "useFontScaling(" << scaling << ");";
310 return ss.str();
311 }
312
306 } // namespace viewer 313 } // namespace viewer
307 314
308 } // namespace dom_distiller 315 } // namespace dom_distiller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698