Commit 5277f834 authored by Xiaohui Chen's avatar Xiaohui Chen Committed by Commit Bot

assistant: cleanup dead code

Bug: None
Test: locally build and run
Change-Id: Ifdb6e31b926da18c6da47e7a2a5540f58e9fa9a9
Reviewed-on: https://chromium-review.googlesource.com/c/1423620Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Xiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625391}
parent 81865e4b
...@@ -10,18 +10,6 @@ ...@@ -10,18 +10,6 @@
cr.define('settings', function() { cr.define('settings', function() {
/** @interface */ /** @interface */
class GoogleAssistantBrowserProxy { class GoogleAssistantBrowserProxy {
/**
* Enables or disables the Google Assistant.
* @param {boolean} enabled
*/
setGoogleAssistantEnabled(enabled) {}
/**
* Enables or disables screen context for the Google Assistant.
* @param {boolean} enabled
*/
setGoogleAssistantContextEnabled(enabled) {}
/** Launches into the Google Assistant app settings. */ /** Launches into the Google Assistant app settings. */
launchGoogleAssistantSettings() {} launchGoogleAssistantSettings() {}
...@@ -34,16 +22,6 @@ cr.define('settings', function() { ...@@ -34,16 +22,6 @@ cr.define('settings', function() {
/** @implements {settings.GoogleAssistantBrowserProxy} */ /** @implements {settings.GoogleAssistantBrowserProxy} */
class GoogleAssistantBrowserProxyImpl { class GoogleAssistantBrowserProxyImpl {
/** @override */
setGoogleAssistantEnabled(enabled) {
chrome.send('setGoogleAssistantEnabled', [enabled]);
}
/** @override */
setGoogleAssistantContextEnabled(enabled) {
chrome.send('setGoogleAssistantContextEnabled', [enabled]);
}
/** @override */ /** @override */
showGoogleAssistantSettings() { showGoogleAssistantSettings() {
chrome.send('showGoogleAssistantSettings'); chrome.send('showGoogleAssistantSettings');
......
...@@ -19,16 +19,14 @@ ...@@ -19,16 +19,14 @@
class="first primary-toggle" class="first primary-toggle"
pref="{{prefs.settings.voice_interaction.enabled}}" pref="{{prefs.settings.voice_interaction.enabled}}"
label="[[getAssistantOnOffLabel_( label="[[getAssistantOnOffLabel_(
prefs.settings.voice_interaction.enabled.value)]]" prefs.settings.voice_interaction.enabled.value)]]">
on-change="onGoogleAssistantEnableChange_">
</settings-toggle-button> </settings-toggle-button>
<template is="dom-if" <template is="dom-if"
if="[[prefs.settings.voice_interaction.enabled.value]]"> if="[[prefs.settings.voice_interaction.enabled.value]]">
<settings-toggle-button id="googleAssistantContextEnable" <settings-toggle-button id="googleAssistantContextEnable"
pref="{{prefs.settings.voice_interaction.context.enabled}}" pref="{{prefs.settings.voice_interaction.context.enabled}}"
label="$i18n{googleAssistantEnableContext}" label="$i18n{googleAssistantEnableContext}"
sub-label="$i18n{googleAssistantEnableContextDescription}" sub-label="$i18n{googleAssistantEnableContextDescription}">
on-change="onGoogleAssistantContextEnableChange_">
</settings-toggle-button> </settings-toggle-button>
<template is="dom-if" if="[[assistantFeatureEnabled_]]"> <template is="dom-if" if="[[assistantFeatureEnabled_]]">
<settings-toggle-button id="googleAssistantHotwordEnable" <settings-toggle-button id="googleAssistantHotwordEnable"
......
...@@ -96,18 +96,6 @@ Polymer({ ...@@ -96,18 +96,6 @@ Polymer({
return this.i18n(toggleValue ? 'toggleOn' : 'toggleOff'); return this.i18n(toggleValue ? 'toggleOn' : 'toggleOff');
}, },
/** @private */
onGoogleAssistantEnableChange_: function() {
this.browserProxy_.setGoogleAssistantEnabled(
!!this.getPref('settings.voice_interaction.enabled.value'));
},
/** @private */
onGoogleAssistantContextEnableChange_: function() {
this.browserProxy_.setGoogleAssistantContextEnabled(
!!this.getPref('settings.voice_interaction.context.enabled.value'));
},
/** @private */ /** @private */
onGoogleAssistantSettingsTapped_: function() { onGoogleAssistantSettingsTapped_: function() {
this.browserProxy_.showGoogleAssistantSettings(); this.browserProxy_.showGoogleAssistantSettings();
......
...@@ -8,22 +8,10 @@ ...@@ -8,22 +8,10 @@
class TestGoogleAssistantBrowserProxy extends TestBrowserProxy { class TestGoogleAssistantBrowserProxy extends TestBrowserProxy {
constructor() { constructor() {
super([ super([
'setGoogleAssistantEnabled',
'setGoogleAssistantContextEnabled',
'showGoogleAssistantSettings', 'showGoogleAssistantSettings',
]); ]);
} }
/** @override */
setGoogleAssistantEnabled(enabled) {
this.methodCalled('setGoogleAssistantEnabled', enabled);
}
/** @override */
setGoogleAssistantContextEnabled(enabled) {
this.methodCalled('setGoogleAssistantContextEnabled', enabled);
}
/** @override */ /** @override */
showGoogleAssistantSettings() { showGoogleAssistantSettings() {
this.methodCalled('showGoogleAssistantSettings'); this.methodCalled('showGoogleAssistantSettings');
...@@ -69,8 +57,6 @@ suite('GoogleAssistantHandler', function() { ...@@ -69,8 +57,6 @@ suite('GoogleAssistantHandler', function() {
button.click(); button.click();
Polymer.dom.flush(); Polymer.dom.flush();
assertTrue(button.checked); assertTrue(button.checked);
return browserProxy.whenCalled('setGoogleAssistantEnabled')
.then(assertTrue);
}); });
test('toggleAssistantContext', function() { test('toggleAssistantContext', function() {
...@@ -86,8 +72,6 @@ suite('GoogleAssistantHandler', function() { ...@@ -86,8 +72,6 @@ suite('GoogleAssistantHandler', function() {
button.click(); button.click();
Polymer.dom.flush(); Polymer.dom.flush();
assertTrue(button.checked); assertTrue(button.checked);
return browserProxy.whenCalled('setGoogleAssistantContextEnabled')
.then(assertTrue);
}); });
test('tapOnAssistantSettings', function() { test('tapOnAssistantSettings', function() {
......
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