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

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: moved observerwrapper to inner class, renamed observer wrapper, styling, build.gn added 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..f22cb169368a72a8a84370caddfe60961ff4626e 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 {
nyquist 2014/07/23 17:30:46 Could you file a bug and assign to me about making
sunangel 2014/07/23 18:04:31 It is bug 396697. Let me know if I did not do it r
+ public:
+ DistilledPagePrefsObserverAndroid(JNIEnv* env, jobject obj);
+ virtual ~DistilledPagePrefsObserverAndroid();
+
+ // DistilledPagePrefs::Observer
nyquist 2014/07/23 17:30:46 Nit: End comment with . Also, how about something
sunangel 2014/07/23 18:04:31 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698