| Index: chrome/browser/resources/hotword_helper/optin_client.js
|
| diff --git a/chrome/browser/resources/hotword_helper/optin_client.js b/chrome/browser/resources/hotword_helper/optin_client.js
|
| index a688df76b9eb30159037a66f81eaa7ad2005976c..8ac22de318643af0fc7a724ed1c0b1ab9d946855 100644
|
| --- a/chrome/browser/resources/hotword_helper/optin_client.js
|
| +++ b/chrome/browser/resources/hotword_helper/optin_client.js
|
| @@ -35,7 +35,11 @@ OptInClient.CommandFromPage = {
|
| // User has explicitly clicked 'no'.
|
| CLICKED_NO_OPTIN: 'hcno',
|
| // User has opted in.
|
| - CLICKED_OPTIN: 'hco'
|
| + CLICKED_OPTIN: 'hco',
|
| + // Audio logging is opted in.
|
| + AUDIO_LOGGING_ON: 'alon',
|
| + // Audio logging is opted out.
|
| + AUDIO_LOGGING_OFF: 'aloff',
|
| };
|
|
|
|
|
| @@ -49,23 +53,15 @@ OptInClient.EXISTS_ = 'chwoihe';
|
|
|
| /**
|
| * Handles the messages posted to the window, mainly listening for
|
| - * the optin and no optin clicks.
|
| + * the optin and no optin clicks. Also listening for preference on
|
| + * audio logging.
|
| * @param {!MessageEvent} messageEvent Message event from the window.
|
| * @private
|
| */
|
| OptInClient.prototype.handleCommandFromPage_ = function(messageEvent) {
|
| if (messageEvent.source === window && messageEvent.data.type) {
|
| var command = messageEvent.data.type;
|
| - switch (command) {
|
| - case OptInClient.CommandFromPage.CLICKED_OPTIN:
|
| - chrome.runtime.sendMessage(
|
| - {'type': command});
|
| - break;
|
| - case OptInClient.CommandFromPage.CLICKED_NO_OPTIN:
|
| - chrome.runtime.sendMessage(
|
| - {'type': command});
|
| - break;
|
| - }
|
| + chrome.runtime.sendMessage({'type': command});
|
| }
|
| };
|
|
|
|
|