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() {
8 chrome
.hotwordPrivate
.getLocalizedStrings(function(strings
) {
9 loadTimeData
.data
= strings
;
10 i18nTemplate
.process(document
, loadTimeData
);
12 var flow
= new Flow();
15 var pressFunction = function(e
) {
16 // Only respond to 'Enter' key presses.
17 if (e
.type
== 'keyup' && e
.keyIdentifier
!= 'Enter')
20 var classes
= e
.target
.classList
;
21 if (classes
.contains('close') || classes
.contains('finish-button')) {
26 if (classes
.contains('retry-button')) {
32 $('steps').addEventListener('click', pressFunction
);
33 $('steps').addEventListener('keyup', pressFunction
);
35 $('audio-history-agree').addEventListener('click', function(e
) {
36 flow
.enableAudioHistory();
40 $('hotword-start').addEventListener('click', function(e
) {
45 $('settings-link').addEventListener('click', function(e
) {
46 chrome
.browser
.openTab({'url': 'chrome://settings'}, function() {});