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 #include "chrome/browser/android/dom_distiller/feedback_reporter_android.h" | 5 #include "chrome/browser/android/dom_distiller/feedback_reporter_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "components/dom_distiller/core/feedback_reporter.h" | 10 #include "components/dom_distiller/core/feedback_reporter.h" |
11 #include "components/dom_distiller/core/url_utils.h" | 11 #include "components/dom_distiller/core/url_utils.h" |
12 #include "content/public/browser/navigation_details.h" | 12 #include "content/public/browser/navigation_details.h" |
13 #include "content/public/browser/navigation_entry.h" | 13 #include "content/public/browser/navigation_entry.h" |
14 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
15 #include "content/public/common/frame_navigate_params.h" | 15 #include "content/public/common/frame_navigate_params.h" |
16 #include "jni/DomDistillerFeedbackReporter_jni.h" | 16 #include "jni/DomDistillerFeedbackReporter_jni.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 namespace dom_distiller { | 19 namespace dom_distiller { |
20 | 20 |
21 namespace android { | 21 namespace android { |
22 | 22 |
23 // static | 23 // static |
24 jboolean IsEnabled(JNIEnv* env, jclass clazz) { | 24 jboolean IsEnabled(JNIEnv* env, jclass clazz) { |
25 return CommandLine::ForCurrentProcess()->HasSwitch( | 25 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
26 switches::kEnableDomDistiller); | 26 switches::kEnableDomDistiller); |
27 } | 27 } |
28 | 28 |
29 // static | 29 // static |
30 void ReportQuality(JNIEnv* env, jclass clazz, jboolean j_good) { | 30 void ReportQuality(JNIEnv* env, jclass clazz, jboolean j_good) { |
31 FeedbackReporter::ReportQuality(j_good); | 31 FeedbackReporter::ReportQuality(j_good); |
32 } | 32 } |
33 | 33 |
34 FeedbackReporterAndroid::FeedbackReporterAndroid(JNIEnv* env, jobject obj) | 34 FeedbackReporterAndroid::FeedbackReporterAndroid(JNIEnv* env, jobject obj) |
35 : weak_java_feedback_reporter_(env, obj) {} | 35 : weak_java_feedback_reporter_(env, obj) {} |
(...skipping 28 matching lines...) Expand all Loading... |
64 FeedbackReporterAndroid* reporter = new FeedbackReporterAndroid(env, obj); | 64 FeedbackReporterAndroid* reporter = new FeedbackReporterAndroid(env, obj); |
65 return reinterpret_cast<intptr_t>(reporter); | 65 return reinterpret_cast<intptr_t>(reporter); |
66 } | 66 } |
67 | 67 |
68 // static | 68 // static |
69 bool RegisterFeedbackReporter(JNIEnv* env) { return RegisterNativesImpl(env); } | 69 bool RegisterFeedbackReporter(JNIEnv* env) { return RegisterNativesImpl(env); } |
70 | 70 |
71 } // namespace android | 71 } // namespace android |
72 | 72 |
73 } // namespace dom_distiller | 73 } // namespace dom_distiller |
OLD | NEW |