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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_ANDROID_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_ANDROID_H_
10 #include "base/android/scoped_java_ref.h"
11 #include "components/dom_distiller/core/distilled_page_prefs.h"
13 namespace dom_distiller
{
16 class DistilledPagePrefsAndroid
{
18 DistilledPagePrefsAndroid(JNIEnv
* env
,
20 DistilledPagePrefs
* distilled_page_prefs_ptr
);
21 virtual ~DistilledPagePrefsAndroid();
22 static bool Register(JNIEnv
* env
);
23 void SetFontFamily(JNIEnv
* env
, jobject obj
, jint font_family
);
24 jint
GetFontFamily(JNIEnv
* env
, jobject obj
);
25 void SetTheme(JNIEnv
* env
, jobject obj
, jint theme
);
26 jint
GetTheme(JNIEnv
* env
, jobject obj
);
28 void AddObserver(JNIEnv
* env
, jobject obj
, jlong obs
);
29 void RemoveObserver(JNIEnv
* env
, jobject obj
, jlong obs
);
32 DistilledPagePrefs
* distilled_page_prefs_
;
34 DISALLOW_COPY_AND_ASSIGN(DistilledPagePrefsAndroid
);
37 class DistilledPagePrefsObserverAndroid
: public DistilledPagePrefs::Observer
{
39 DistilledPagePrefsObserverAndroid(JNIEnv
* env
, jobject obj
);
40 virtual ~DistilledPagePrefsObserverAndroid();
42 // DistilledPagePrefs::Observer implementation.
43 void OnChangeFontFamily(
44 DistilledPagePrefs::FontFamily new_font_family
) override
;
45 void OnChangeTheme(DistilledPagePrefs::Theme new_theme
) override
;
47 virtual void DestroyObserverAndroid(JNIEnv
* env
, jobject obj
);
50 base::android::ScopedJavaGlobalRef
<jobject
> java_ref_
;
53 } // namespace android
54 } // namespace dom_distiller
56 #endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_ANDROID_H_