1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var appWindow = chrome.app.window.current();
7 document.addEventListener('DOMContentLoaded', function() {
11 // Make the close buttons close the app window.
12 var closeButtons = document.getElementsByClassName('close');
13 for (var i = 0; i < closeButtons.length; ++i) {
14 var closeButton = closeButtons[i];
15 closeButton.addEventListener('click', function(e) {
21 $('ah-cancel-button').addEventListener('click', function(e) {
26 $('hw-cancel-button').addEventListener('click', function(e) {
31 $('st-cancel-button').addEventListener('click', function(e) {
36 $('ah-agree-button').addEventListener('click', function(e) {
37 // TODO(kcarattini): Set the Audio History setting.
42 $('hw-agree-button').addEventListener('click', function(e) {
47 // TODO(kcarattini): Remove this once speech training is implemented. The
48 // way to get to the next page will be to complete the speech training.
49 $('training').addEventListener('click', function(e) {
50 if (chrome.hotwordPrivate.setAudioLoggingEnabled)
51 chrome.hotwordPrivate.setAudioLoggingEnabled(true, function() {});
53 if (chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled) {
54 chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled(true,
55 flow.advanceStep.bind(flow));
60 $('try-now-button').addEventListener('click', function(e) {
61 // TODO(kcarattini): Figure out what happens when you click this button.