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

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

Issue 521483003: Hotword Audio Verification App: Adds hotwording assets and basic opt-in flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review Comments Created 6 years, 3 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
new file mode 100644
index 0000000000000000000000000000000000000000..c180e0732dc54560cc21b9c5057cbc87be29400c
--- /dev/null
+++ b/chrome/browser/resources/hotword_audio_verification/main.js
@@ -0,0 +1,61 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var appWindow = chrome.app.window.current();
+
+document.addEventListener('DOMContentLoaded', function() {
+ var flow = new Flow();
+ flow.startFlow();
+
+ // Make the close buttons close the app window.
+ var closeButtons = document.getElementsByClassName('close');
+ for (var i = 0; i < closeButtons.length; ++i) {
+ var closeButton = closeButtons[i];
+ closeButton.addEventListener('click', function(e) {
+ appWindow.close();
+ e.stopPropagation();
+ });
+ }
+
+ $('ah-cancel-button').addEventListener('click', function(e) {
+ appWindow.close();
+ e.stopPropagation();
+ });
+
+ $('hw-cancel-button').addEventListener('click', function(e) {
+ appWindow.close();
+ e.stopPropagation();
+ });
+
+ $('st-cancel-button').addEventListener('click', function(e) {
+ appWindow.close();
+ e.stopPropagation();
+ });
+
+ $('ah-agree-button').addEventListener('click', function(e) {
+ // TODO(kcarattini): Set the Audio History setting.
+ appWindow.close();
+ e.stopPropagation();
+ });
+
+ $('hw-agree-button').addEventListener('click', function(e) {
+ // TODO(kcarattini): Set the Audio History setting.
+ flow.advanceStep();
+ 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.
+ $('training').addEventListener('click', function(e) {
+ // TODO(kcarattini): Set the always-on-hotword setting.
+ flow.advanceStep();
+ e.stopPropagation();
+ });
+
+ $('try-now-button').addEventListener('click', function(e) {
+ // TODO(kcarattini): Figure out what happens when you click this button.
+ appWindow.close();
+ e.stopPropagation();
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698