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

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

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/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 e6fb247376cc241fd7e981b7ff9e90e352ad0fd7..051d821c2e4ca8de1388efb579659f40cbe52b4d 100644
--- a/components/dom_distiller/core/distilled_page_prefs_android.cc
+++ b/components/dom_distiller/core/distilled_page_prefs_android.cc
@@ -22,12 +22,24 @@ DistilledPagePrefsAndroid::DistilledPagePrefsAndroid(
DistilledPagePrefsAndroid::~DistilledPagePrefsAndroid() {
}
+void DistilledPagePrefsAndroid::SetFontFamily(JNIEnv* env,
+ jobject obj,
+ jint font_family) {
+ distilled_page_prefs_->SetFontFamily(
+ static_cast<DistilledPagePrefs::FontFamily>(font_family));
+}
+
+jint DistilledPagePrefsAndroid::GetFontFamily(JNIEnv* env, jobject obj) {
+ return (int) distilled_page_prefs_->GetFontFamily();
+}
+
void DistilledPagePrefsAndroid::SetTheme(JNIEnv* env, jobject obj, jint theme) {
- distilled_page_prefs_->SetTheme((DistilledPagePrefs::Theme)theme);
+ distilled_page_prefs_->SetTheme(
+ static_cast<DistilledPagePrefs::Theme>(theme));
}
jint DistilledPagePrefsAndroid::GetTheme(JNIEnv* env, jobject obj) {
- return (int)distilled_page_prefs_->GetTheme();
+ return (int) distilled_page_prefs_->GetTheme();
}
jlong Init(JNIEnv* env, jobject obj, jlong distilled_page_prefs_ptr) {
@@ -71,6 +83,13 @@ void DistilledPagePrefsObserverAndroid::DestroyObserverAndroid(JNIEnv* env,
delete this;
}
+void DistilledPagePrefsObserverAndroid::OnChangeFontFamily(
+ DistilledPagePrefs::FontFamily new_font_family) {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_DistilledPagePrefsObserverWrapper_onChangeFontFamily(
+ env, java_ref_.obj(), (int)new_font_family);
+}
+
void DistilledPagePrefsObserverAndroid::OnChangeTheme(
DistilledPagePrefs::Theme new_theme) {
JNIEnv* env = base::android::AttachCurrentThread();

Powered by Google App Engine
This is Rietveld 408576698