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 (function() { | 5 (function() { |
6 | 6 |
7 // Correspond to steps in the hotword opt-in flow. | 7 // Correspond to steps in the hotword opt-in flow. |
8 /** @const */ var HOTWORD_AUDIO_HISTORY = 'hotword-audio-history-container'; | 8 /** @const */ var HOTWORD_AUDIO_HISTORY = 'hotword-audio-history-container'; |
9 /** @const */ var HOTWORD_ONLY_START = 'hotword-only-container'; | 9 /** @const */ var HOTWORD_ONLY_START = 'hotword-only-container'; |
10 /** @const */ var AUDIO_HISTORY_START = 'audio-history-container'; | 10 /** @const */ var AUDIO_HISTORY_START = 'audio-history-container'; |
11 /** @const */ var SPEECH_TRAINING = 'speech-training-container'; | 11 /** @const */ var SPEECH_TRAINING = 'speech-training-container'; |
12 /** @const */ var FINISHED = 'finished-container'; | 12 /** @const */ var FINISHED = 'finished-container'; |
13 | 13 |
14 /** | 14 /** |
15 * These flows correspond to the three LaunchModes as defined in | 15 * These flows correspond to the three LaunchModes as defined in |
16 * chrome/browser/search/hotword_service.h and should be kept in sync | 16 * chrome/browser/search/hotword_service.h and should be kept in sync |
17 * with them. | 17 * with them. |
18 * @const | 18 * @const |
19 */ | 19 */ |
20 var FLOWS = [ | 20 var FLOWS = [ |
| 21 // TODO(kcarattini): Remove the first flow, since we will not be |
| 22 // managing the Audio History Setting in Chrome anymore. |
21 [AUDIO_HISTORY_START], | 23 [AUDIO_HISTORY_START], |
22 [HOTWORD_ONLY_START, SPEECH_TRAINING, FINISHED], | 24 [HOTWORD_ONLY_START, SPEECH_TRAINING, FINISHED], |
23 [HOTWORD_AUDIO_HISTORY, SPEECH_TRAINING, FINISHED] | 25 [HOTWORD_AUDIO_HISTORY, SPEECH_TRAINING, FINISHED], |
| 26 [SPEECH_TRAINING, FINISHED] |
24 ]; | 27 ]; |
25 | 28 |
26 /** | 29 /** |
27 * Class to control the page flow of the always-on hotword and | 30 * Class to control the page flow of the always-on hotword and |
28 * Audio History opt-in process. | 31 * Audio History opt-in process. |
29 * @constructor | 32 * @constructor |
30 */ | 33 */ |
31 function Flow() { | 34 function Flow() { |
32 this.currentStepIndex_ = -1; | 35 this.currentStepIndex_ = -1; |
33 this.currentFlow_ = []; | 36 this.currentFlow_ = []; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 previousStep = this.currentFlow_[this.currentStepIndex_ - 1]; | 79 previousStep = this.currentFlow_[this.currentStepIndex_ - 1]; |
77 | 80 |
78 if (previousStep) | 81 if (previousStep) |
79 document.getElementById(previousStep).hidden = true; | 82 document.getElementById(previousStep).hidden = true; |
80 | 83 |
81 document.getElementById(currentStep).hidden = false; | 84 document.getElementById(currentStep).hidden = false; |
82 }; | 85 }; |
83 | 86 |
84 window.Flow = Flow; | 87 window.Flow = Flow; |
85 })(); | 88 })(); |
OLD | NEW |