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

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

Issue 430473007: Font Family Preferences for Distilled Pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: synced Created 6 years, 4 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/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);

Powered by Google App Engine
This is Rietveld 408576698