OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_ANDROID_DOM_DISTILLER_FEEDBACK_REPORTER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DOM_DISTILLER_FEEDBACK_REPORTER_ANDROID_H_ |
6 #define CHROME_BROWSER_ANDROID_DOM_DISTILLER_FEEDBACK_REPORTER_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_DOM_DISTILLER_FEEDBACK_REPORTER_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 struct FrameNavigateParams; | 15 struct FrameNavigateParams; |
16 struct LoadCommittedDetails; | 16 struct LoadCommittedDetails; |
17 } // namespace content | 17 } // namespace content |
18 | 18 |
19 namespace dom_distiller { | 19 namespace dom_distiller { |
20 | 20 |
21 namespace android { | 21 namespace android { |
22 | 22 |
23 class FeedbackReporterAndroid : content::WebContentsObserver { | 23 class FeedbackReporterAndroid : content::WebContentsObserver { |
24 public: | 24 public: |
25 FeedbackReporterAndroid(JNIEnv* env, jobject obj); | 25 FeedbackReporterAndroid(JNIEnv* env, jobject obj); |
26 virtual ~FeedbackReporterAndroid(); | 26 ~FeedbackReporterAndroid() override; |
27 | 27 |
28 // Destroys the FeedbackReporterAndroid. | 28 // Destroys the FeedbackReporterAndroid. |
29 void Destroy(JNIEnv* env, jobject obj); | 29 void Destroy(JNIEnv* env, jobject obj); |
30 | 30 |
31 // Observes a new WebContents, if necessary. | 31 // Observes a new WebContents, if necessary. |
32 void ReplaceWebContents(JNIEnv* env, jobject obj, jobject jweb_contents); | 32 void ReplaceWebContents(JNIEnv* env, jobject obj, jobject jweb_contents); |
33 | 33 |
34 // WebContentsObserver implementation: | 34 // WebContentsObserver implementation: |
35 virtual void DidNavigateMainFrame( | 35 void DidNavigateMainFrame( |
36 const content::LoadCommittedDetails& details, | 36 const content::LoadCommittedDetails& details, |
37 const content::FrameNavigateParams& params) override; | 37 const content::FrameNavigateParams& params) override; |
38 | 38 |
39 private: | 39 private: |
40 // FeedbackReporterAndroid on the Java side. | 40 // FeedbackReporterAndroid on the Java side. |
41 JavaObjectWeakGlobalRef weak_java_feedback_reporter_; | 41 JavaObjectWeakGlobalRef weak_java_feedback_reporter_; |
42 | 42 |
43 DISALLOW_COPY_AND_ASSIGN(FeedbackReporterAndroid); | 43 DISALLOW_COPY_AND_ASSIGN(FeedbackReporterAndroid); |
44 }; | 44 }; |
45 | 45 |
46 // Registers the FeedbackReporter's native methods through JNI. | 46 // Registers the FeedbackReporter's native methods through JNI. |
47 bool RegisterFeedbackReporter(JNIEnv* env); | 47 bool RegisterFeedbackReporter(JNIEnv* env); |
48 | 48 |
49 } // namespace android | 49 } // namespace android |
50 | 50 |
51 } // namespace dom_distiller | 51 } // namespace dom_distiller |
52 | 52 |
53 #endif // CHROME_BROWSER_ANDROID_DOM_DISTILLER_FEEDBACK_REPORTER_ANDROID_H_ | 53 #endif // CHROME_BROWSER_ANDROID_DOM_DISTILLER_FEEDBACK_REPORTER_ANDROID_H_ |
OLD | NEW |