use of org.chromium.chrome.browser.feedback.FeedbackCollector in project AndroidChromium by JackyAndroid.
the class ChildAccountFeedbackReporter method reportFeedback.
public static void reportFeedback(Activity activity, final String description, String url) {
ThreadUtils.assertOnUiThread();
if (sFeedbackReporter == null) {
ChromeApplication application = (ChromeApplication) activity.getApplication();
sFeedbackReporter = application.createFeedbackReporter();
}
FeedbackCollector.create(activity, Profile.getLastUsedProfile(), url, new FeedbackCollector.FeedbackResult() {
@Override
public void onResult(FeedbackCollector collector) {
collector.setDescription(description);
sFeedbackReporter.reportFeedback(collector);
}
});
}
use of org.chromium.chrome.browser.feedback.FeedbackCollector in project AndroidChromium by JackyAndroid.
the class DomDistillerUIUtils method reportFeedbackWithWebContents.
/**
* A static method for native code to open the external feedback form UI.
* @param webContents The WebContents containing the distilled content.
* @param url The URL to report feedback for.
* @param good True if the feedback is good and false if not.
*/
@CalledByNative
public static void reportFeedbackWithWebContents(WebContents webContents, String url, final boolean good) {
ThreadUtils.assertOnUiThread();
// TODO(mdjones): It would be better to get the WebContents from the manager so that the
// native code does not need to depend on RenderFrame.
Activity activity = getActivityFromWebContents(webContents);
if (activity == null)
return;
if (sFeedbackReporter == null) {
ChromeApplication application = (ChromeApplication) activity.getApplication();
sFeedbackReporter = application.createFeedbackReporter();
}
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(collector);
}
});
}
Aggregations