Index: components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/DistilledPagePrefs.java |
diff --git a/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/DistilledPagePrefs.java b/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/DistilledPagePrefs.java |
index 3ba9f7ea82d8c7facdf39e2a982de411cd0d1a03..2f249d0073f85e0ca35ee7140e0b5437ee5c25c9 100644 |
--- a/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/DistilledPagePrefs.java |
+++ b/components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core/DistilledPagePrefs.java |
@@ -24,6 +24,7 @@ public final class DistilledPagePrefs { |
* Observer interface for observing DistilledPagePrefs changes. |
*/ |
public interface Observer { |
+ void onChangeFontFamily(FontFamily font); |
void onChangeTheme(Theme theme); |
} |
@@ -40,6 +41,12 @@ public final class DistilledPagePrefs { |
} |
@CalledByNative("DistilledPagePrefsObserverWrapper") |
+ private void onChangeFontFamily(int fontFamily) { |
+ mDistilledPagePrefsObserver.onChangeFontFamily( |
+ FontFamily.getFontFamilyForValue(fontFamily)); |
+ } |
+ |
+ @CalledByNative("DistilledPagePrefsObserverWrapper") |
private void onChangeTheme(int theme) { |
mDistilledPagePrefsObserver.onChangeTheme(Theme.getThemeForValue(theme)); |
} |
@@ -90,6 +97,14 @@ public final class DistilledPagePrefs { |
return true; |
} |
+ public void setFontFamily(FontFamily fontFamily) { |
+ nativeSetFontFamily(mDistilledPagePrefsAndroid, fontFamily.asNativeEnum()); |
+ } |
+ |
+ public FontFamily getFontFamily() { |
+ return FontFamily.getFontFamilyForValue(nativeGetFontFamily(mDistilledPagePrefsAndroid)); |
+ } |
+ |
public void setTheme(Theme theme) { |
nativeSetTheme(mDistilledPagePrefsAndroid, theme.asNativeEnum()); |
} |
@@ -100,6 +115,10 @@ public final class DistilledPagePrefs { |
private native long nativeInit(long distilledPagePrefPtr); |
+ private native void nativeSetFontFamily(long nativeDistilledPagePrefsAndroid, int fontFamily); |
+ |
+ private native int nativeGetFontFamily(long nativeDistilledPagePrefsAndroid); |
+ |
private native void nativeSetTheme(long nativeDistilledPagePrefsAndroid, int theme); |
private native int nativeGetTheme(long nativeDistilledPagePrefsAndroid); |