Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: chrome/browser/resources/hotword_helper/optin_client.js

Issue 212253003: [Hotword] Update helper extension to listen for change to audio logging preference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo, cleanup Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/hotword_helper/manager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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});
}
};
« no previous file with comments | « chrome/browser/resources/hotword_helper/manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698