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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/help/HelpAndFeedback.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/help/HelpAndFeedback.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/help/HelpAndFeedback.java b/chrome/android/java/src/org/chromium/chrome/browser/help/HelpAndFeedback.java
index 1857a3585a12edf50593b3a2fca3d2d32bead2c1..9f6fa2c463a710f9523f78c7eefe04757e8f6190 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/help/HelpAndFeedback.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/help/HelpAndFeedback.java
@@ -18,8 +18,10 @@ import org.chromium.chrome.browser.ChromeApplication;
import org.chromium.chrome.browser.UrlConstants;
import org.chromium.chrome.browser.UrlUtilities;
import org.chromium.chrome.browser.feedback.FeedbackCollector;
+import org.chromium.chrome.browser.profiles.Profile;
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
/**
* Launches an activity that displays a relevant support page and has an option to provide feedback.
@@ -52,11 +54,32 @@ public class HelpAndFeedback {
* context and will be used to show a more relevant help page.
* @param collector the {@link FeedbackCollector} to use for extra data. Must not be null.
*/
- public void show(Activity activity, String helpContext, @Nonnull FeedbackCollector collector) {
+ protected void show(
+ Activity activity, String helpContext, @Nonnull FeedbackCollector collector) {
launchFallbackSupportUri(activity);
}
/**
+ * Starts an activity showing a help page for the specified context ID.
+ *
+ * @param activity The activity to use for starting the help activity and to take a
+ * screenshot of.
+ * @param helpContext One of the CONTEXT_* constants. This should describe the user's current
+ * context and will be used to show a more relevant help page.
+ * @param profile the current profile.
+ * @param url the current URL. May be null.
+ */
+ public void show(final Activity activity, final String helpContext, Profile profile,
+ @Nullable String url) {
+ FeedbackCollector.create(activity, profile, url, new FeedbackCollector.FeedbackResult() {
+ @Override
+ public void onResult(FeedbackCollector collector) {
+ show(activity, helpContext, collector);
+ }
+ });
+ }
+
+ /**
* Get help context ID from URL.
*
* @param url The URL to be checked.

Powered by Google App Engine
This is Rietveld 408576698