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

Unified Diff: components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/Theme.template

Issue 340403004: Java wrapper for DistilledPagePrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: stylistic changes, rename ThemeTestPref, remove unnecessary files 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/android/java/src/org/chromium/components/dom_distiller/core/Theme.template
diff --git a/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/Theme.template b/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/Theme.template
new file mode 100644
index 0000000000000000000000000000000000000000..b700bd88c65606e2c3075666a15c385729ff36f6
--- /dev/null
+++ b/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/Theme.template
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.components.dom_distiller.core;
+
+// An auto-generated enum for Distilled Page Theme preferences as used by
+// org.chromium.components.dom_distiller.core.DistilledPagePrefs and
+// the corresponding native class
+// dom_distiller::android::DistilledPagePrefsAndroid
+public enum Theme {
+
+#define DEFINE_THEME(unused, name, value) name(value),
+#include "components/dom_distiller/core/theme_list.h"
+#undef DEFINE_THEME
+;
+
+private final int mValue;
+
+private Theme(int value) {
+ mValue = value;
+}
+
+// Package protected.
nyquist 2014/07/10 15:59:58 Nit: I don't think we usually have these types of
sunangel 2014/07/10 20:19:55 Done.
+int asNativeEnum() {
+ return mValue;
+}
+
+// Package protected.
+static Theme getThemeForValue(int value) {
+ for (Theme theme: Theme.values()) {
+ if (theme.mValue == value) {
+ return theme;
+ }
+ }
+ return null;
+}
+
+}

Powered by Google App Engine
This is Rietveld 408576698