Chromium Code Reviews| 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..b8fa0dab8659f15945bb17b0612ebe71776b5fbd |
| --- /dev/null |
| +++ b/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/Theme.template |
| @@ -0,0 +1,37 @@ |
| +// 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; |
| +} |
| + |
| +public int asNativeEnum() { |
|
nyquist
2014/07/09 23:49:04
package protected?
sunangel
2014/07/10 14:31:53
Done. I remember you said that sometimes people ad
|
| + return mValue; |
| +} |
| + |
| +public static Theme getThemeForValue(int value) { |
|
nyquist
2014/07/09 23:49:04
package protected?
sunangel
2014/07/10 14:31:53
Done.
|
| + for (Theme theme: Theme.values()) { |
| + if (theme.mValue == value) { |
| + return theme; |
| + } |
| + } |
| + return null; |
| +} |
| + |
| +} |