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

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

Issue 403323005: Observer Support for DistilledPagePrefs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added removeObserver after test is done, styling 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_observer_wrapper.h
diff --git a/components/dom_distiller/core/distilled_page_prefs_observer_wrapper.h b/components/dom_distiller/core/distilled_page_prefs_observer_wrapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..b62f3a9cb2f1c084f9738315e148868b86967ba9
--- /dev/null
+++ b/components/dom_distiller/core/distilled_page_prefs_observer_wrapper.h
@@ -0,0 +1,29 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_OBSERVER_WRAPPER_H_
+#define COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_OBSERVER_WRAPPER_H_
+
+#include <jni.h>
+
+#include "base/android/scoped_java_ref.h"
+#include "components/dom_distiller/core/distilled_page_prefs.h"
+
+namespace dom_distiller {
+
+class DistilledPagePrefsObserverWrapper : public DistilledPagePrefs::Observer {
+ public:
+ DistilledPagePrefsObserverWrapper(JNIEnv* env, jobject obj);
+ virtual ~DistilledPagePrefsObserverWrapper();
+ void Destroy(JNIEnv* env, jobject obj);
+ static bool Register(JNIEnv* env);
+ virtual void OnChangeTheme(DistilledPagePrefs::Theme new_theme) OVERRIDE;
robliao 2014/07/21 21:05:09 It's customary to separate the override and add a
sunangel 2014/07/21 22:43:55 Done.
+
+ private:
+ base::android::ScopedJavaGlobalRef<jobject> java_ref_;
+};
+
+} // namespace dom_distiller
+
+#endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLED_PAGE_PREFS_OBSERVER_WRAPPER_H_

Powered by Google App Engine
This is Rietveld 408576698