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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerFeedbackReporter.java

Issue 1222453002: [Feedback] Use callbacks for FeedbackCollector and use ScreenshotTask (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-feedback-collector-test
Patch Set: Squashed branch Created 5 years, 6 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/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerFeedbackReporter.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerFeedbackReporter.java b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerFeedbackReporter.java
index 965653951357994e4c6c4dd62eac972c9aa0efe3..9fd5f40126ba35b0d807e9bc9688d8843186a773 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerFeedbackReporter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerFeedbackReporter.java
@@ -33,17 +33,24 @@ public final class DomDistillerFeedbackReporter {
* @param good True if the feedback is good and false if not.
*/
@CalledByNative
- public static void reportFeedbackWithWindow(WindowAndroid window, String url, boolean good) {
+ public static void reportFeedbackWithWindow(
+ WindowAndroid window, String url, final boolean good) {
ThreadUtils.assertOnUiThread();
- Activity activity = window.getActivity().get();
+ final Activity activity = window.getActivity().get();
if (sFeedbackReporter == null) {
ChromeApplication application = (ChromeApplication) activity.getApplication();
sFeedbackReporter = application.createFeedbackReporter();
}
- FeedbackCollector collector = FeedbackCollector.create(Profile.getLastUsedProfile(), url);
- String quality = good ? DISTILLATION_QUALITY_GOOD : DISTILLATION_QUALITY_BAD;
- collector.add(DISTILLATION_QUALITY_KEY, quality);
- sFeedbackReporter.reportFeedback(activity, collector);
+ FeedbackCollector.create(activity, Profile.getLastUsedProfile(), url,
+ new FeedbackCollector.FeedbackResult() {
+ @Override
+ public void onResult(FeedbackCollector collector) {
+ String quality =
+ good ? DISTILLATION_QUALITY_GOOD : DISTILLATION_QUALITY_BAD;
+ collector.add(DISTILLATION_QUALITY_KEY, quality);
+ sFeedbackReporter.reportFeedback(activity, collector);
+ }
+ });
}
private DomDistillerFeedbackReporter() {}

Powered by Google App Engine
This is Rietveld 408576698