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

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: Created 6 years, 4 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..0538cb0bf5e9edbfae3f99e5c9292c293c7ac216
--- /dev/null
+++ b/chrome/browser/resources/hotword_audio_verification/main.js
@@ -0,0 +1,59 @@
+// 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.
+
benwells 2014/09/01 01:28:48 Instead of setting appWindow in the background pag
kcarattini 2014/09/01 06:59:06 Done.
+document.addEventListener('DOMContentLoaded', function() {
+ window.flow = new Flow();
+ window.flow.startFlow();
+
+ // Make the close buttons close the app window.
+ var closeButtons = document.getElementsByClassName('x');
+ for (var i = 0; i < closeButtons.length; ++i) {
+ var closeButton = closeButtons[i];
+ closeButton.addEventListener('click', function(e) {
+ appWindow.close();
+ e.stopPropagation();
+ });
+ }
+
+ $('ah-no-thanks-button').addEventListener('click', function(e) {
+ appWindow.close();
+ e.stopPropagation();
+ });
+
+ $('no-thanks-button').addEventListener('click', function(e) {
+ appWindow.close();
+ e.stopPropagation();
+ });
+
+ $('finish-later-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();
+ });
+
+ $('agree-button').addEventListener('click', function(e) {
+ // TODO(kcarattini): Set the Audio History setting.
+ window.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.
+ window.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