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

Unified Diff: chrome/browser/android/dom_distiller/feedback_reporter_android.h

Issue 197473006: Add FeedbackReporter for reporting distillation quality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed disableUI again and comment Created 6 years, 9 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: 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_
« no previous file with comments | « chrome/browser/android/chrome_jni_registrar.cc ('k') | chrome/browser/android/dom_distiller/feedback_reporter_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698