Skip to content

Commit

Permalink
Add feedback source for Duet
Browse files Browse the repository at this point in the history
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/1181575
Reviewed-by: Theresa <twellington@chromium.org>
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584781}
  • Loading branch information
iotitan authored and Commit Bot committed Aug 21, 2018
1 parent b9181af commit 7acbe2e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// 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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ protected List<FeedbackSource> buildSynchronousFeedbackSources(
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) {
Expand Down
1 change: 1 addition & 0 deletions chrome/android/java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 7acbe2e

Please sign in to comment.