Chromium Code Reviews| 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..9ed75ebde1055adef604360bef8aa4bc2f81a8f1 |
| --- /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() { |
| + window.flow = new Flow(); |
|
Bernhard Bauer
2014/09/01 10:16:23
Is there a reason you need to put this into the gl
kcarattini
2014/09/02 04:37:23
Done.
|
| + window.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. |
| + 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(); |
| + }); |
| +}); |