Commit 7acbe2e5 authored by Matthew Jones's avatar Matthew Jones Committed by Commit Bot

Add feedback source for Duet

This patch adds a feedback source for the split toolbar that
identifies whether the feature is enabled.

Change-Id: I5a1455c246e9ad5a6a2d36a452a580678fe59dd0
Reviewed-on: https://chromium-review.googlesource.com/1181575Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584781}
parent b9181af2
// Copyright 2018 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 org.chromium.chrome.browser.util.FeatureUtilities;
import java.util.HashMap;
import java.util.Map;
/** Provides whether Duet is enabled for feedback reports. */
public class DuetFeedbackSource implements FeedbackSource {
private static final String DUET_KEY = "Duet";
private static final String ENABLED_VALUE = "Enabled";
private static final String DISABLED_VALUE = "Disabled";
private final HashMap<String, String> mMap;
DuetFeedbackSource() {
mMap = new HashMap<>(1);
mMap.put(DUET_KEY,
FeatureUtilities.isBottomToolbarEnabled() ? ENABLED_VALUE : DISABLED_VALUE);
}
@Override
public Map<String, String> getFeedback() {
return mMap;
}
}
......@@ -86,6 +86,7 @@ public class FeedbackCollector implements Runnable {
sources.add(new PermissionFeedbackSource());
sources.add(new SimplifiedNtpFeedbackSource());
sources.add(new FeedbackContextFeedbackSource(feedbackContext));
sources.add(new DuetFeedbackSource());
// Sanity check in case a source is added to the wrong list.
for (FeedbackSource source : sources) {
......
......@@ -564,6 +564,7 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/feedback/ConnectivityFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/ConnectivityTask.java",
"java/src/org/chromium/chrome/browser/feedback/DataReductionProxyFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/DuetFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java",
"java/src/org/chromium/chrome/browser/feedback/FeedbackContextFeedbackSource.java",
"java/src/org/chromium/chrome/browser/feedback/FeedbackReporter.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