Commit b1752527 authored by kcarattini's avatar kcarattini Committed by Commit bot

Hotword: Adds a field for always_on_available to the API StatusDetails

This field is used when deciding whether to show the NTP promo.

BUG=436681

Review URL: https://codereview.chromium.org/1011913005

Cr-Commit-Position: refs/heads/master@{#320874}
parent 9dd3b7f9
......@@ -151,12 +151,15 @@ bool HotwordPrivateGetStatusFunction::RunSync() {
HotwordServiceFactory::GetForProfile(GetProfile());
if (!hotword_service) {
result.available = false;
result.always_on_available = false;
result.enabled = false;
result.audio_logging_enabled = false;
result.always_on_enabled = false;
result.user_is_active = false;
} else {
result.available = hotword_service->IsServiceAvailable();
result.always_on_available =
HotwordServiceFactory::IsAlwaysOnAvailable();
result.enabled = hotword_service->IsSometimesOnEnabled();
result.audio_logging_enabled = hotword_service->IsOptedIntoAudioLogging();
result.training_enabled = hotword_service->IsTraining();
......
......@@ -454,8 +454,10 @@ cr.define('hotword', function() {
statusDone_: function(tab, sendResponse, hotwordStatus) {
var response = {'doNotShowOptinMessage': true};
// If always-on is available, then we do not show the promo, as the promo
// only works with the sometimes-on pref.
if (!tab.incognito && hotwordStatus.available &&
!hotwordStatus.enabledSet) {
!hotwordStatus.enabledSet && !hotwordStatus.alwaysOnAvailable) {
response = hotwordStatus;
}
......
......@@ -23,6 +23,9 @@ namespace hotwordPrivate {
// Whether the hotword extension is available to be enabled
boolean available;
// Whether always-on is available to be enabled
boolean alwaysOnAvailable;
// Whether the sound of "Ok, Google" plus a few seconds before is sent
// back to Google.
boolean audioLoggingEnabled;
......
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