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

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: Re-add lost code, small change to browser_options.js 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.
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) {
Dan Beam 2014/09/23 05:53:38 do you expect this to fail ever?
kcarattini 2014/09/23 06:46:16 No. Changed to assert.
52 flow.advanceStep(); 51 if (chrome.hotwordPrivate.setAudioLoggingEnabled) {
Dan Beam 2014/09/23 05:53:38 nit: no curlies
kcarattini 2014/09/23 06:46:16 Done.
52 chrome.hotwordPrivate.setAudioLoggingEnabled(true, function() {});
53 }
54
55 if (chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled) {
56 chrome.hotwordPrivate.setHotwordAlwaysOnSearchEnabled(true,
57 flow.advanceStep.bind(flow));
58 }
59 }
53 e.stopPropagation(); 60 e.stopPropagation();
54 }); 61 });
55 62
56 $('try-now-button').addEventListener('click', function(e) { 63 $('try-now-button').addEventListener('click', function(e) {
57 // TODO(kcarattini): Figure out what happens when you click this button. 64 // TODO(kcarattini): Figure out what happens when you click this button.
58 appWindow.close(); 65 appWindow.close();
59 e.stopPropagation(); 66 e.stopPropagation();
60 }); 67 });
61 }); 68 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698