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

Side by Side Diff: chrome/browser/resources/hotword_audio_verification/main.js

Issue 559303002: Hotword Audio Verification app: control the hotword settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@launch-state
Patch Set: Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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
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. 43 if (chrome.hotwordPrivate && chrome.hotwordPrivate.setAudioLoggingEnabled) {
44 flow.advanceStep(); 44 chrome.hotwordPrivate.setAudioLoggingEnabled(true,
45 flow.advanceStep.bind(flow));
rpetterson 2014/09/11 20:14:17 Based on the discussion with Hwi, should this move
kcarattini 2014/09/12 01:02:07 Done.
46 }
45 e.stopPropagation(); 47 e.stopPropagation();
46 }); 48 });
47 49
48 // TODO(kcarattini): Remove this once speech training is implemented. The 50 // 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. 51 // way to get to the next page will be to complete the speech training.
50 $('training').addEventListener('click', function(e) { 52 $('training').addEventListener('click', function(e) {
51 // TODO(kcarattini): Set the always-on-hotword setting. 53 if (chrome.hotwordPrivate &&
52 flow.advanceStep(); 54 chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled) {
55 chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled(true,
56 flow.advanceStep.bind(flow));
57 }
53 e.stopPropagation(); 58 e.stopPropagation();
54 }); 59 });
55 60
56 $('try-now-button').addEventListener('click', function(e) { 61 $('try-now-button').addEventListener('click', function(e) {
57 // TODO(kcarattini): Figure out what happens when you click this button. 62 // TODO(kcarattini): Figure out what happens when you click this button.
58 appWindow.close(); 63 appWindow.close();
59 e.stopPropagation(); 64 e.stopPropagation();
60 }); 65 });
61 }); 66 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698