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

Unified Diff: components/dom_distiller/content/resources/dom_distiller_viewer.js

Issue 341563002: Theme Preferences for Distilled Pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor change - dependency order Created 6 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 side-by-side diff with in-line comments
Download patch
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;
+}

Powered by Google App Engine
This is Rietveld 408576698