| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var appWindow = chrome.app.window.current(); | 5 var appWindow = chrome.app.window.current(); |
| 6 | 6 |
| 7 document.addEventListener('DOMContentLoaded', function() { | 7 document.addEventListener('DOMContentLoaded', function() { |
| 8 var flow = new Flow(); | 8 var flow = new Flow(); |
| 9 flow.startFlow(); | 9 flow.startFlow(); |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 e.stopPropagation(); | 33 e.stopPropagation(); |
| 34 }); | 34 }); |
| 35 | 35 |
| 36 $('ah-agree-button').addEventListener('click', function(e) { | 36 $('ah-agree-button').addEventListener('click', function(e) { |
| 37 // TODO(kcarattini): Set the Audio History setting. | 37 // TODO(kcarattini): Set the Audio History setting. |
| 38 appWindow.close(); | 38 appWindow.close(); |
| 39 e.stopPropagation(); | 39 e.stopPropagation(); |
| 40 }); | 40 }); |
| 41 | 41 |
| 42 $('hw-agree-button').addEventListener('click', function(e) { | 42 $('hw-agree-button').addEventListener('click', function(e) { |
| 43 // TODO(kcarattini): Set the Audio History setting. | |
| 44 flow.advanceStep(); | 43 flow.advanceStep(); |
| 45 e.stopPropagation(); | 44 e.stopPropagation(); |
| 46 }); | 45 }); |
| 47 | 46 |
| 48 // TODO(kcarattini): Remove this once speech training is implemented. The | 47 // TODO(kcarattini): Remove this once speech training is implemented. The |
| 49 // way to get to the next page will be to complete the speech training. | 48 // way to get to the next page will be to complete the speech training. |
| 50 $('training').addEventListener('click', function(e) { | 49 $('training').addEventListener('click', function(e) { |
| 51 // TODO(kcarattini): Set the always-on-hotword setting. | 50 if (chrome.hotwordPrivate.setAudioLoggingEnabled) |
| 52 flow.advanceStep(); | 51 chrome.hotwordPrivate.setAudioLoggingEnabled(true, function() {}); |
| 52 |
| 53 if (chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled) { |
| 54 chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled(true, |
| 55 flow.advanceStep.bind(flow)); |
| 56 } |
| 53 e.stopPropagation(); | 57 e.stopPropagation(); |
| 54 }); | 58 }); |
| 55 | 59 |
| 56 $('try-now-button').addEventListener('click', function(e) { | 60 $('try-now-button').addEventListener('click', function(e) { |
| 57 // TODO(kcarattini): Figure out what happens when you click this button. | 61 // TODO(kcarattini): Figure out what happens when you click this button. |
| 58 appWindow.close(); | 62 appWindow.close(); |
| 59 e.stopPropagation(); | 63 e.stopPropagation(); |
| 60 }); | 64 }); |
| 61 }); | 65 }); |
| OLD | NEW |