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

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

Issue 1225183002: Font size in DomDistiller prefs syncs with local scaling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge master again Created 5 years, 3 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 8a448654b4ca1c963dbe34b768aa831cdbb1483d..6b35bc0a4a9d7800ce87b7cec207c2831a250d83 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
@@ -26,6 +26,7 @@ public final class DistilledPagePrefs {
public interface Observer {
void onChangeFontFamily(FontFamily font);
void onChangeTheme(Theme theme);
+ void onChangeFontScaling(float scaling);
}
/**
@@ -51,6 +52,11 @@ public final class DistilledPagePrefs {
mDistilledPagePrefsObserver.onChangeTheme(Theme.getThemeForValue(theme));
}
+ @CalledByNative("DistilledPagePrefsObserverWrapper")
+ private void onChangeFontScaling(float scaling) {
+ mDistilledPagePrefsObserver.onChangeFontScaling(scaling);
+ }
+
public void destroy() {
nativeDestroyObserverAndroid(mNativeDistilledPagePrefsObserverAndroidPtr);
}
@@ -113,6 +119,14 @@ public final class DistilledPagePrefs {
return Theme.getThemeForValue(nativeGetTheme(mDistilledPagePrefsAndroid));
}
+ public void setFontScaling(float scaling) {
+ nativeSetFontScaling(mDistilledPagePrefsAndroid, scaling);
+ }
+
+ public float getFontScaling() {
+ return nativeGetFontScaling(mDistilledPagePrefsAndroid);
+ }
+
private native long nativeInit(long distilledPagePrefPtr);
private native void nativeSetFontFamily(long nativeDistilledPagePrefsAndroid, int fontFamily);
@@ -123,6 +137,10 @@ public final class DistilledPagePrefs {
private native int nativeGetTheme(long nativeDistilledPagePrefsAndroid);
+ private native void nativeSetFontScaling(long nativeDistilledPagePrefsAndroid, float scaling);
+
+ private native float nativeGetFontScaling(long nativeDistilledPagePrefsAndroid);
+
private native void nativeAddObserver(long nativeDistilledPagePrefsAndroid,
long nativeObserverPtr);

Powered by Google App Engine
This is Rietveld 408576698