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

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: send message to extension 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
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..6eccdb1475ee1615c40941ae608a4dd3cc058f9d 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,7 +53,8 @@ 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
*/
@@ -65,6 +70,14 @@ OptInClient.prototype.handleCommandFromPage_ = function(messageEvent) {
chrome.runtime.sendMessage(
{'type': command});
break;
+ case OptInClient.CommandFromPage.AUDIO_LOGGING_ON:
+ chrome.runtime.sendMessage(
+ {'type': command});
+ break;
+ case OptInClient.CommandFromPage.AUDIO_LOGGING_OFF:
+ chrome.runtime.sendMessage(
+ {'type': command});
saurya1 2014/03/27 16:29:22 If you want to clean this up you can just remove t
rpetterson 2014/03/27 16:37:19 I assume I don't actually need the switch statemen
+ break;
}
}
};

Powered by Google App Engine
This is Rietveld 408576698