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

Side by Side Diff: components/dom_distiller/core/distilled_page_prefs_android.h

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, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_ANDROID_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_ANDROID_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_ANDROID_H_ 6 #define COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
11 #include "components/dom_distiller/core/distilled_page_prefs.h" 11 #include "components/dom_distiller/core/distilled_page_prefs.h"
12 12
13 namespace dom_distiller { 13 namespace dom_distiller {
14 namespace android { 14 namespace android {
15 15
16 class DistilledPagePrefsAndroid { 16 class DistilledPagePrefsAndroid {
17 public: 17 public:
18 DistilledPagePrefsAndroid(JNIEnv* env, 18 DistilledPagePrefsAndroid(JNIEnv* env,
19 jobject obj, 19 jobject obj,
20 DistilledPagePrefs* distilled_page_prefs_ptr); 20 DistilledPagePrefs* distilled_page_prefs_ptr);
21 virtual ~DistilledPagePrefsAndroid(); 21 virtual ~DistilledPagePrefsAndroid();
22 static bool Register(JNIEnv* env); 22 static bool Register(JNIEnv* env);
23 void SetFontFamily(JNIEnv* env, jobject obj, jint font_family); 23 void SetFontFamily(JNIEnv* env, jobject obj, jint font_family);
24 jint GetFontFamily(JNIEnv* env, jobject obj); 24 jint GetFontFamily(JNIEnv* env, jobject obj);
25 void SetTheme(JNIEnv* env, jobject obj, jint theme); 25 void SetTheme(JNIEnv* env, jobject obj, jint theme);
26 jint GetTheme(JNIEnv* env, jobject obj); 26 jint GetTheme(JNIEnv* env, jobject obj);
27 void SetFontScaling(JNIEnv* env, jobject obj, jfloat scaling);
28 jfloat GetFontScaling(JNIEnv* env, jobject obj);
27 29
28 void AddObserver(JNIEnv* env, jobject obj, jlong obs); 30 void AddObserver(JNIEnv* env, jobject obj, jlong obs);
29 void RemoveObserver(JNIEnv* env, jobject obj, jlong obs); 31 void RemoveObserver(JNIEnv* env, jobject obj, jlong obs);
30 32
31 private: 33 private:
32 DistilledPagePrefs* distilled_page_prefs_; 34 DistilledPagePrefs* distilled_page_prefs_;
33 35
34 DISALLOW_COPY_AND_ASSIGN(DistilledPagePrefsAndroid); 36 DISALLOW_COPY_AND_ASSIGN(DistilledPagePrefsAndroid);
35 }; 37 };
36 38
37 class DistilledPagePrefsObserverAndroid : public DistilledPagePrefs::Observer { 39 class DistilledPagePrefsObserverAndroid : public DistilledPagePrefs::Observer {
38 public: 40 public:
39 DistilledPagePrefsObserverAndroid(JNIEnv* env, jobject obj); 41 DistilledPagePrefsObserverAndroid(JNIEnv* env, jobject obj);
40 virtual ~DistilledPagePrefsObserverAndroid(); 42 virtual ~DistilledPagePrefsObserverAndroid();
41 43
42 // DistilledPagePrefs::Observer implementation. 44 // DistilledPagePrefs::Observer implementation.
43 void OnChangeFontFamily( 45 void OnChangeFontFamily(
44 DistilledPagePrefs::FontFamily new_font_family) override; 46 DistilledPagePrefs::FontFamily new_font_family) override;
45 void OnChangeTheme(DistilledPagePrefs::Theme new_theme) override; 47 void OnChangeTheme(DistilledPagePrefs::Theme new_theme) override;
48 void OnChangeFontScaling(float scaling) override;
46 49
47 virtual void DestroyObserverAndroid(JNIEnv* env, jobject obj); 50 virtual void DestroyObserverAndroid(JNIEnv* env, jobject obj);
48 51
49 private: 52 private:
50 base::android::ScopedJavaGlobalRef<jobject> java_ref_; 53 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
51 }; 54 };
52 55
53 } // namespace android 56 } // namespace android
54 } // namespace dom_distiller 57 } // namespace dom_distiller
55 58
56 #endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_ANDROID_H_ 59 #endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_ANDROID_H_
OLDNEW
« no previous file with comments | « components/dom_distiller/core/distilled_page_prefs.cc ('k') | components/dom_distiller/core/distilled_page_prefs_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698