Index: components/dom_distiller/content/resources/dom_distiller_viewer.js |
diff --git a/components/dom_distiller/content/resources/dom_distiller_viewer.js b/components/dom_distiller/content/resources/dom_distiller_viewer.js |
index 854e1d0152a6486791b3b643fbfaec78379e4836..94299467ef3df0b6ffa129f1ee149d008e58eec8 100644 |
--- a/components/dom_distiller/content/resources/dom_distiller_viewer.js |
+++ b/components/dom_distiller/content/resources/dom_distiller_viewer.js |
@@ -11,4 +11,18 @@ function addToPage(html) { |
function showLoadingIndicator(isLastPage) { |
document.getElementById('loadingIndicator').className = |
isLastPage ? 'hidden' : 'visible'; |
-} |
+} |
+ |
+// Maps JS theme to CSS class and then changes body class name. |
+// CSS classes must agree with distilledpage.css. |
+function useTheme(theme) { |
+ var cssClass; |
+ if (theme == "sepia") { |
+ cssClass = "sepia"; |
+ } else if (theme == "dark") { |
+ cssClass = "dark"; |
+ } else { |
+ cssClass = "light"; |
+ } |
+ document.body.className = cssClass; |
+} |