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

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

Issue 403323005: Observer Support for DistilledPagePrefs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed observerMap type from HashMap to Map Created 6 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.h
diff --git a/components/dom_distiller/core/distilled_page_prefs_android.h b/components/dom_distiller/core/distilled_page_prefs_android.h
index baf7398065f37a8c5039dd7b28ebf5b836d1cb4b..6f0b1c8d8dfc692f8a86c059113bd0b746cd9de6 100644
--- a/components/dom_distiller/core/distilled_page_prefs_android.h
+++ b/components/dom_distiller/core/distilled_page_prefs_android.h
@@ -17,11 +17,13 @@ class DistilledPagePrefsAndroid {
public:
DistilledPagePrefsAndroid(JNIEnv* env,
jobject obj,
- DistilledPagePrefs* distillerPagePrefsPtr);
+ DistilledPagePrefs* distilled_page_prefs_ptr);
virtual ~DistilledPagePrefsAndroid();
static bool Register(JNIEnv* env);
void SetTheme(JNIEnv* env, jobject obj, jint theme);
jint GetTheme(JNIEnv* env, jobject obj);
+ void AddObserver(JNIEnv* env, jobject obj, jlong obs);
+ void RemoveObserver(JNIEnv* env, jobject obj, jlong obs);
private:
DistilledPagePrefs* distilled_page_prefs_;
@@ -29,6 +31,20 @@ class DistilledPagePrefsAndroid {
DISALLOW_COPY_AND_ASSIGN(DistilledPagePrefsAndroid);
};
+class DistilledPagePrefsObserverAndroid : public DistilledPagePrefs::Observer {
+ public:
+ DistilledPagePrefsObserverAndroid(JNIEnv* env, jobject obj);
+ virtual ~DistilledPagePrefsObserverAndroid();
+
+ // DistilledPagePrefs::Observer implementation.
+ virtual void OnChangeTheme(DistilledPagePrefs::Theme new_theme) OVERRIDE;
+
+ virtual void DestroyObserverAndroid(JNIEnv* env, jobject obj);
+
+ private:
+ base::android::ScopedJavaGlobalRef<jobject> java_ref_;
+};
+
} // namespace android
} // namespace dom_distiller
« no previous file with comments | « components/dom_distiller/core/BUILD.gn ('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