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

Unified Diff: components/dom_distiller/core/distilled_page_prefs_android.cc

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/core/distilled_page_prefs_android.cc
diff --git a/components/dom_distiller/core/distilled_page_prefs_android.cc b/components/dom_distiller/core/distilled_page_prefs_android.cc
index 051d821c2e4ca8de1388efb579659f40cbe52b4d..914ba7b968a85f0c777770307f382ac9079b6a97 100644
--- a/components/dom_distiller/core/distilled_page_prefs_android.cc
+++ b/components/dom_distiller/core/distilled_page_prefs_android.cc
@@ -42,6 +42,16 @@ jint DistilledPagePrefsAndroid::GetTheme(JNIEnv* env, jobject obj) {
return (int) distilled_page_prefs_->GetTheme();
}
+void DistilledPagePrefsAndroid::SetFontScaling(JNIEnv* env,
+ jobject obj,
+ jfloat scaling) {
+ distilled_page_prefs_->SetFontScaling(static_cast<float>(scaling));
+}
+
+jfloat DistilledPagePrefsAndroid::GetFontScaling(JNIEnv* env, jobject obj) {
+ return distilled_page_prefs_->GetFontScaling();
+}
+
jlong Init(JNIEnv* env, jobject obj, jlong distilled_page_prefs_ptr) {
DistilledPagePrefs* distilled_page_prefs =
reinterpret_cast<DistilledPagePrefs*>(distilled_page_prefs_ptr);
@@ -97,6 +107,13 @@ void DistilledPagePrefsObserverAndroid::OnChangeTheme(
env, java_ref_.obj(), (int)new_theme);
}
+void DistilledPagePrefsObserverAndroid::OnChangeFontScaling(
+ float scaling) {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_DistilledPagePrefsObserverWrapper_onChangeFontScaling(
+ env, java_ref_.obj(), scaling);
+}
+
jlong InitObserverAndroid(JNIEnv* env, jobject obj) {
DistilledPagePrefsObserverAndroid* observer_android =
new DistilledPagePrefsObserverAndroid(env, obj);

Powered by Google App Engine
This is Rietveld 408576698