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

Unified Diff: chrome/browser/resources/hotword_audio_verification/main.js

Issue 669603007: Adds the page for hotword-only to the opt-in flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 6 years, 2 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_audio_verification/main.js
diff --git a/chrome/browser/resources/hotword_audio_verification/main.js b/chrome/browser/resources/hotword_audio_verification/main.js
index 46f870947c87c9928049df0c2ceb89e9712b7e08..8c78ef4a4f05b56f796e6e51e81022f7d3b88722 100644
--- a/chrome/browser/resources/hotword_audio_verification/main.js
+++ b/chrome/browser/resources/hotword_audio_verification/main.js
@@ -14,39 +14,49 @@ document.addEventListener('DOMContentLoaded', function() {
var closeButton = closeButtons[i];
closeButton.addEventListener('click', function(e) {
appWindow.close();
- e.stopPropagation();
+ e.preventDefault();
});
}
$('ah-cancel-button').addEventListener('click', function(e) {
appWindow.close();
- e.stopPropagation();
+ e.preventDefault();
+ });
+
+ $('done-button').addEventListener('click', function(e) {
+ appWindow.close();
+ e.preventDefault();
+ });
+
+ $('ho-cancel-button').addEventListener('click', function(e) {
+ appWindow.close();
+ e.preventDefault();
});
$('hw-cancel-button').addEventListener('click', function(e) {
appWindow.close();
- e.stopPropagation();
+ e.preventDefault();
});
$('st-cancel-button').addEventListener('click', function(e) {
appWindow.close();
- e.stopPropagation();
+ e.preventDefault();
});
$('ah-agree-button').addEventListener('click', function(e) {
// TODO(kcarattini): Set the Audio History setting.
appWindow.close();
- e.stopPropagation();
+ e.preventDefault();
});
$('hw-agree-button').addEventListener('click', function(e) {
flow.advanceStep();
- e.stopPropagation();
+ e.preventDefault();
});
// TODO(kcarattini): Remove this once speech training is implemented. The
// way to get to the next page will be to complete the speech training.
- $('training').addEventListener('click', function(e) {
+ $('st-training').addEventListener('click', function(e) {
if (chrome.hotwordPrivate.setAudioLoggingEnabled)
chrome.hotwordPrivate.setAudioLoggingEnabled(true, function() {});
@@ -54,12 +64,19 @@ document.addEventListener('DOMContentLoaded', function() {
chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled(true,
flow.advanceStep.bind(flow));
}
- e.stopPropagation();
+ e.preventDefault();
});
- $('try-now-button').addEventListener('click', function(e) {
- // TODO(kcarattini): Figure out what happens when you click this button.
- appWindow.close();
- e.stopPropagation();
+ // TODO(kcarattini): Remove this once speech training is implemented. The
+ // way to get to the next page will be to complete the speech training.
+ $('ho-training').addEventListener('click', function(e) {
+ if (chrome.hotwordPrivate.setAudioLoggingEnabled)
+ chrome.hotwordPrivate.setAudioLoggingEnabled(true, function() {});
+
+ if (chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled) {
+ chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled(true,
+ flow.advanceStep.bind(flow));
+ }
+ e.preventDefault();
});
});

Powered by Google App Engine
This is Rietveld 408576698