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

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: keep focus when useFontScaling() is called, add tests Created 5 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/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 2f249d0073f85e0ca35ee7140e0b5437ee5c25c9..d738d26ce8353f356fc30b2e656a54bb2d745c52 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