Commit e6ad3229 authored by David Trainor's avatar David Trainor Committed by Commit Bot

Added a way to send feedback from AppHooks.

BUG=773403

Change-Id: Ie6eb72cb6b83321c3ca2094645bab8340879da9d
Reviewed-on: https://chromium-review.googlesource.com/798217Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521040}
parent 71fb4990
......@@ -19,7 +19,11 @@ import org.chromium.chrome.browser.banners.AppDetailsDelegate;
import org.chromium.chrome.browser.customtabs.CustomTabsConnection;
import org.chromium.chrome.browser.datausage.ExternalDataUseObserver;
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
import org.chromium.chrome.browser.feedback.AsyncFeedbackSource;
import org.chromium.chrome.browser.feedback.FeedbackCollector;
import org.chromium.chrome.browser.feedback.FeedbackReporter;
import org.chromium.chrome.browser.feedback.FeedbackSource;
import org.chromium.chrome.browser.feedback.FeedbackSourceProvider;
import org.chromium.chrome.browser.gsa.GSAHelper;
import org.chromium.chrome.browser.help.HelpAndFeedback;
import org.chromium.chrome.browser.historyreport.AppIndexingReporter;
......@@ -331,4 +335,12 @@ public abstract class AppHooks {
public PartnerBrowserCustomizations.Provider getCustomizationProvider() {
return new PartnerBrowserCustomizations.ProviderPackage();
}
/**
* @return A {@link FeedbackSourceProvider} that can provide additional {@link FeedbackSource}s
* and {@link AsyncFeedbackSource}s to be used by a {@link FeedbackCollector}.
*/
public FeedbackSourceProvider getAdditionalFeedbackSources() {
return new FeedbackSourceProvider() {};
}
}
......@@ -15,6 +15,7 @@ import org.chromium.base.Callback;
import org.chromium.base.CollectionUtil;
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.browser.AppHooks;
import org.chromium.chrome.browser.profiles.Profile;
import java.util.ArrayList;
......@@ -74,6 +75,7 @@ public class FeedbackCollector implements Runnable {
// This is the list of all synchronous sources of feedback. Please add new synchronous
// entries here.
sources.addAll(AppHooks.get().getAdditionalFeedbackSources().getSynchronousSources());
sources.add(new UrlFeedbackSource(url));
sources.add(new VariationsFeedbackSource(profile));
sources.add(new DataReductionProxyFeedbackSource(profile));
......@@ -91,6 +93,7 @@ public class FeedbackCollector implements Runnable {
// This is the list of all asynchronous sources of feedback. Please add new asynchronous
// entries here.
sources.addAll(AppHooks.get().getAdditionalFeedbackSources().getAsynchronousSources());
sources.add(new ConnectivityFeedbackSource(profile));
sources.add(new SystemInfoFeedbackSource());
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.feedback;
import java.util.ArrayList;
import java.util.Collection;
/**
* Used for an external component to be able to provide extra feedback sources to the
* FeedbackCollector. In general it is best to add the sources directly to FeedbackCollector, but
* if there are DEPS or repository reasons for not doing that, they can be provided through here.
*/
public interface FeedbackSourceProvider {
// clang-format off
// TODO(crbug.com/781015): Clang isn't formatting this correctly.
/** @return A list of {@link FeedbackSource}s to add to a {@link FeedbackCollector}. */
default Collection<FeedbackSource> getSynchronousSources() { return new ArrayList<>(); }
/** @return A list of {@link AsyncFeedbackSource}s to add to a {@link FeedbackCollector}. */
default Collection<AsyncFeedbackSource> getAsynchronousSources() { return new ArrayList<>(); }
// clang-format on
}
......@@ -415,6 +415,7 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java",
"java/src/org/chromium/chrome/browser/feedback/FeedbackReporter.java",
"java/src/org/chromium/chrome/browser/feedback/FeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/FeedbackSourceProvider.java",
"java/src/org/chromium/chrome/browser/feedback/HistogramFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/IMEFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/LowEndDeviceFeedbackSource.java",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment