Commit 9531fa20 authored by Xiaohui Chen's avatar Xiaohui Chen Committed by Commit Bot

assistant: guard voice match setting ui with flag

The settings ui should only show when feature is enabled.
Also hide the "delete" button for now per ux request.

Bug: b:123254533
Test: locally build and run
Change-Id: Ice44a9888b2d02f901206518967aea2d7bdb43a4
Reviewed-on: https://chromium-review.googlesource.com/c/1434755Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Xiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626283}
parent 48ba2dc5
......@@ -59,25 +59,26 @@
</template>
</select>
</div>
<div class="settings-box two-line" hidden=
"[[!prefs.settings.voice_interaction.hotword.enabled.value]]">
<div class="start text-area">
<div class="label">
$i18n{googleAssistantVoiceSettings}
</div>
<div class="secondary label">
$i18n{googleAssistantVoiceSettingsDescription}
<template is="dom-if" if="[[voiceMatchEnabled_]]">
<div class="settings-box two-line">
<div class="start text-area">
<div class="label">
$i18n{googleAssistantVoiceSettings}
</div>
<div class="secondary label">
$i18n{googleAssistantVoiceSettingsDescription}
</div>
</div>
<paper-button id="button" class="secondary-button"
on-click="onRetrainVoiceModelTapped_">
$i18n{googleAssistantVoiceSettingsRetrainButton}
</paper-button>
<paper-button id="button" class="secondary-button"
on-click="onDeleteVoiceModelTapped_">
$i18n{googleAssistantVoiceSettingsDeleteButton}
</paper-button>
</div>
<paper-button id="button" class="secondary-button"
on-click="onRetrainVoiceModelTapped_">
$i18n{googleAssistantVoiceSettingsRetrainButton}
</paper-button>
<paper-button id="button" class="secondary-button"
on-click="onDeleteVoiceModelTapped_">
$i18n{googleAssistantVoiceSettingsDeleteButton}
</paper-button>
</div>
</template>
<settings-toggle-button id="googleAssistantNotificationEnable"
pref="{{prefs.settings.voice_interaction.notification.enabled}}"
label="$i18n{googleAssistantEnableNotification}"
......
......@@ -30,6 +30,12 @@ Polymer({
},
},
/** @private */
voiceMatchEnabled_: {
type: Boolean,
value: false,
},
/** @private */
hotwordDspAvailable_: {
type: Boolean,
......@@ -148,6 +154,9 @@ Polymer({
/** @private */
onPrefsChanged_: function() {
this.refreshDspHotwordState_();
this.voiceMatchEnabled_ = loadTimeData.getBoolean('voiceMatchEnabled') &&
this.getPref('settings.voice_interaction.hotword.enabled.value');
},
/** @private */
......
......@@ -2263,6 +2263,11 @@ void AddGoogleAssistantStrings(content::WebUIDataSource* html_source) {
html_source->AddBoolean("hotwordDspAvailable",
chromeos::IsHotwordDspAvailable());
html_source->AddBoolean(
"voiceMatchEnabled",
base::FeatureList::IsEnabled(
chromeos::assistant::features::kAssistantVoiceMatch));
}
#endif
......
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