OLD | NEW |
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" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
| 13 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
14 #include "components/dom_distiller/core/distilled_page_prefs.h" | 15 #include "components/dom_distiller/core/distilled_page_prefs.h" |
15 #include "components/dom_distiller/core/dom_distiller_service.h" | 16 #include "components/dom_distiller/core/dom_distiller_service.h" |
16 #include "components/dom_distiller/core/proto/distilled_article.pb.h" | 17 #include "components/dom_distiller/core/proto/distilled_article.pb.h" |
17 #include "components/dom_distiller/core/proto/distilled_page.pb.h" | 18 #include "components/dom_distiller/core/proto/distilled_page.pb.h" |
18 #include "components/dom_distiller/core/task_tracker.h" | 19 #include "components/dom_distiller/core/task_tracker.h" |
19 #include "components/dom_distiller/core/url_constants.h" | 20 #include "components/dom_distiller/core/url_constants.h" |
20 #include "components/dom_distiller/core/url_utils.h" | 21 #include "components/dom_distiller/core/url_utils.h" |
21 #include "grit/components_resources.h" | 22 #include "grit/components_resources.h" |
22 #include "grit/components_strings.h" | 23 #include "grit/components_strings.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 292 |
292 const std::string GetDistilledPageThemeJs(DistilledPagePrefs::Theme theme) { | 293 const std::string GetDistilledPageThemeJs(DistilledPagePrefs::Theme theme) { |
293 return "useTheme('" + GetJsTheme(theme) + "');"; | 294 return "useTheme('" + GetJsTheme(theme) + "');"; |
294 } | 295 } |
295 | 296 |
296 const std::string GetDistilledPageFontFamilyJs( | 297 const std::string GetDistilledPageFontFamilyJs( |
297 DistilledPagePrefs::FontFamily font_family) { | 298 DistilledPagePrefs::FontFamily font_family) { |
298 return "useFontFamily('" + GetJsFontFamily(font_family) + "');"; | 299 return "useFontFamily('" + GetJsFontFamily(font_family) + "');"; |
299 } | 300 } |
300 | 301 |
| 302 const std::string GetDistilledPageFontScalingJs(float scaling) { |
| 303 return "useFontScaling(" + base::DoubleToString(scaling) + ");"; |
| 304 } |
| 305 |
301 } // namespace viewer | 306 } // namespace viewer |
302 | 307 |
303 } // namespace dom_distiller | 308 } // namespace dom_distiller |
OLD | NEW |