Index: chrome/browser/android/dom_distiller/feedback_reporter_android.h |
diff --git a/chrome/browser/android/dom_distiller/feedback_reporter_android.h b/chrome/browser/android/dom_distiller/feedback_reporter_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3d2d462f70a2fd37c56da261d03c52ac5974ce62 |
--- /dev/null |
+++ b/chrome/browser/android/dom_distiller/feedback_reporter_android.h |
@@ -0,0 +1,55 @@ |
+// 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 CHROME_BROWSER_ANDROID_DOM_DISTILLER_FEEDBACK_REPORTER_ANDROID_H_ |
+#define CHROME_BROWSER_ANDROID_DOM_DISTILLER_FEEDBACK_REPORTER_ANDROID_H_ |
+ |
+#include <jni.h> |
+ |
+#include "base/android/jni_helper.h" |
+#include "content/public/browser/web_contents.h" |
+#include "content/public/browser/web_contents_observer.h" |
+ |
+namespace content { |
+struct FrameNavigateParams; |
+struct LoadCommittedDetails; |
+} // namespace content |
+ |
+namespace dom_distiller { |
+ |
+namespace android { |
+ |
+class FeedbackReporterAndroid : content::WebContentsObserver { |
+ public: |
+ FeedbackReporterAndroid(JNIEnv* env, jobject obj); |
+ virtual ~FeedbackReporterAndroid(); |
+ |
+ // Destroys the FeedbackReporterAndroid. |
+ void Destroy(JNIEnv* env, jobject obj); |
+ |
+ // Observes a new WebContents, if necessary. |
+ void ReplaceWebContents(JNIEnv* env, jobject obj, jobject jweb_contents); |
+ |
+ // WebContentsObserver implementation: |
+ virtual void DidNavigateMainFrame( |
+ const content::LoadCommittedDetails& details, |
+ const content::FrameNavigateParams& params) OVERRIDE; |
+ |
+ static jboolean IsReportableUrl(JNIEnv* env, jclass clazz); |
+ |
+ private: |
+ // FeedbackReporterAndroid on the Java side. |
+ JavaObjectWeakGlobalRef weak_java_feedback_reporter_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FeedbackReporterAndroid); |
+}; |
+ |
+// Registers the FeedbackReporter's native methods through JNI. |
+bool RegisterFeedbackReporter(JNIEnv* env); |
+ |
+} // namespace android |
+ |
+} // namespace dom_distiller |
+ |
+#endif // CHROME_BROWSER_ANDROID_DOM_DISTILLER_FEEDBACK_REPORTER_ANDROID_H_ |