Commit 5ea562fb authored by mgiuca@chromium.org's avatar mgiuca@chromium.org

Settings page: Do not grey out the "Ok Google" checkbox on errors.

Previously, if a mic is not plugged in or some other error occurs (e.g.,
NaCl is disabled), the checkbox is disabled. Now, the checkbox is always
available to turn on or off (with the yellow triangle showing you
whether there is an error).

BUG=396993

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

Cr-Commit-Position: refs/heads/master@{#290201}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290201 0039d316-1c4b-4281-b951-d872f2087c98
parent 6a8103a0
...@@ -210,7 +210,6 @@ cr.define('options', function() { ...@@ -210,7 +210,6 @@ cr.define('options', function() {
var hotwordIndicator = $('hotword-search-setting-indicator'); var hotwordIndicator = $('hotword-search-setting-indicator');
HotwordSearchSettingIndicator.decorate(hotwordIndicator); HotwordSearchSettingIndicator.decorate(hotwordIndicator);
hotwordIndicator.disabledOnErrorSection = $('hotword-search-enable');
chrome.send('requestHotwordAvailable'); chrome.send('requestHotwordAvailable');
if ($('set-wallpaper')) { if ($('set-wallpaper')) {
......
...@@ -49,12 +49,12 @@ cr.define('options', function() { ...@@ -49,12 +49,12 @@ cr.define('options', function() {
return; return;
if (event.value.value && !this.confirmed_) { if (event.value.value && !this.confirmed_) {
if (!this.indicator.errorText) { // If there is an error, show the indicator icon with more information.
PageManager.showPageByName(this.name, false); if (this.indicator.errorText)
} else {
this.indicator.updateBasedOnError(); this.indicator.updateBasedOnError();
this.handleCancel();
} // Show confirmation dialog (regardless of whether there is an error).
PageManager.showPageByName(this.name, false);
} else { } else {
Preferences.getInstance().commitPref(this.pref, this.metric); Preferences.getInstance().commitPref(this.pref, this.metric);
} }
......
...@@ -36,15 +36,6 @@ cr.define('options', function() { ...@@ -36,15 +36,6 @@ cr.define('options', function() {
PageManager.hideBubble(); PageManager.hideBubble();
}, },
/**
* Sets the variable tracking thesection which becomes disabled if an
* error exists.
* @param {HTMLElement} section The section to disable.
*/
set disabledOnErrorSection(section) {
this.disabledOnErrorSection_ = section;
},
/** /**
* Returns the current error. * Returns the current error.
* @return {string} The error message to be displayed. May be undefined if * @return {string} The error message to be displayed. May be undefined if
...@@ -71,8 +62,6 @@ cr.define('options', function() { ...@@ -71,8 +62,6 @@ cr.define('options', function() {
updateBasedOnError: function() { updateBasedOnError: function() {
if (this.errorText_) if (this.errorText_)
this.hidden = false; this.hidden = false;
if (this.disabledOnErrorSection_)
this.disabledOnErrorSection_.disabled = !!this.errorText_;
}, },
/** /**
......
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