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

Unified Diff: chrome/browser/resources/hotword_helper/manager.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/manager.js
diff --git a/chrome/browser/resources/hotword_helper/manager.js b/chrome/browser/resources/hotword_helper/manager.js
index ba0ee5cbb0898611d490209a36eed84080ca2787..0966159cb474f49716272c1d8263bd78019d5641 100644
--- a/chrome/browser/resources/hotword_helper/manager.js
+++ b/chrome/browser/resources/hotword_helper/manager.js
@@ -49,7 +49,11 @@ OptInManager.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',
};
@@ -157,6 +161,25 @@ OptInManager.prototype.handleMessage_ = function(
chrome.hotwordPrivate.setEnabled(false);
}
}
+ // Information regarding the audio logging preference was sent.
+ if (request.type === OptInManager.CommandFromPage.AUDIO_LOGGING_ON) {
+ if (chrome.hotwordPrivate &&
+ chrome.hotwordPrivate.setAudioLoggingEnabled) {
+ chrome.hotwordPrivate.setAudioLoggingEnabled(true);
+ chrome.runtime.sendMessage(
+ OptInManager.HOTWORD_EXTENSION_ID_,
+ {'cmd': OptInManager.CommandFromHelper.AUDIO_LOGGING_OFF});
saurya1 2014/03/27 16:29:22 AUDIO_LOGGING_ON
rpetterson 2014/03/27 16:37:19 Derp. Copy/paste. Fixed.
+ }
+ }
+ if (request.type === OptInManager.CommandFromPage.AUDIO_LOGGING_OFF) {
+ if (chrome.hotwordPrivate &&
+ chrome.hotwordPrivate.setAudioLoggingEnabled) {
+ chrome.hotwordPrivate.setAudioLoggingEnabled(false);
+ chrome.runtime.sendMessage(
+ OptInManager.HOTWORD_EXTENSION_ID_,
+ {'cmd': OptInManager.CommandFromHelper.AUDIO_LOGGING_OFF});
+ }
+ }
}
};

Powered by Google App Engine
This is Rietveld 408576698