| 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/experiments.h" | 17 #include "components/dom_distiller/core/experiments.h" |
| 17 #include "components/dom_distiller/core/proto/distilled_article.pb.h" | 18 #include "components/dom_distiller/core/proto/distilled_article.pb.h" |
| 18 #include "components/dom_distiller/core/proto/distilled_page.pb.h" | 19 #include "components/dom_distiller/core/proto/distilled_page.pb.h" |
| 19 #include "components/dom_distiller/core/task_tracker.h" | 20 #include "components/dom_distiller/core/task_tracker.h" |
| 20 #include "components/dom_distiller/core/url_constants.h" | 21 #include "components/dom_distiller/core/url_constants.h" |
| 21 #include "components/dom_distiller/core/url_utils.h" | 22 #include "components/dom_distiller/core/url_utils.h" |
| 22 #include "grit/components_resources.h" | 23 #include "grit/components_resources.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 300 |
| 300 const std::string GetDistilledPageThemeJs(DistilledPagePrefs::Theme theme) { | 301 const std::string GetDistilledPageThemeJs(DistilledPagePrefs::Theme theme) { |
| 301 return "useTheme('" + GetJsTheme(theme) + "');"; | 302 return "useTheme('" + GetJsTheme(theme) + "');"; |
| 302 } | 303 } |
| 303 | 304 |
| 304 const std::string GetDistilledPageFontFamilyJs( | 305 const std::string GetDistilledPageFontFamilyJs( |
| 305 DistilledPagePrefs::FontFamily font_family) { | 306 DistilledPagePrefs::FontFamily font_family) { |
| 306 return "useFontFamily('" + GetJsFontFamily(font_family) + "');"; | 307 return "useFontFamily('" + GetJsFontFamily(font_family) + "');"; |
| 307 } | 308 } |
| 308 | 309 |
| 310 const std::string GetDistilledPageFontScalingJs(float scaling) { |
| 311 return "useFontScaling(" + base::DoubleToString(scaling) + ");"; |
| 312 } |
| 313 |
| 309 } // namespace viewer | 314 } // namespace viewer |
| 310 | 315 |
| 311 } // namespace dom_distiller | 316 } // namespace dom_distiller |
| OLD | NEW |