| 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 START = 'start-container'; | 8 /** @const */ var START = 'start-container'; |
| 9 /** @const */ var AUDIO_HISTORY = 'audio-history-container'; | 9 /** @const */ var AUDIO_HISTORY = 'audio-history-container'; |
| 10 /** @const */ var SPEECH_TRAINING = 'speech-training-container'; | 10 /** @const */ var SPEECH_TRAINING = 'speech-training-container'; |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 this.advanceStep(); | 543 this.advanceStep(); |
| 544 }; | 544 }; |
| 545 | 545 |
| 546 /** | 546 /** |
| 547 * Displays the current step. If the current step is not the first step, | 547 * Displays the current step. If the current step is not the first step, |
| 548 * also hides the previous step. Focuses the current step's first button. | 548 * also hides the previous step. Focuses the current step's first button. |
| 549 * @private | 549 * @private |
| 550 */ | 550 */ |
| 551 Flow.prototype.showStep_ = function() { | 551 Flow.prototype.showStep_ = function() { |
| 552 var currentStepId = this.currentFlow_[this.currentStepIndex_]; | 552 var currentStepId = this.currentFlow_[this.currentStepIndex_]; |
| 553 var currentStep = document.getElementById(currentStepId); | 553 var currentStep = $(currentStepId); |
| 554 currentStep.hidden = false; | 554 currentStep.hidden = false; |
| 555 | 555 |
| 556 cr.ui.setInitialFocus(currentStep); | 556 cr.ui.setInitialFocus(currentStep); |
| 557 | 557 |
| 558 var previousStep = null; | 558 var previousStep = null; |
| 559 if (this.currentStepIndex_ > 0) | 559 if (this.currentStepIndex_ > 0) |
| 560 previousStep = this.currentFlow_[this.currentStepIndex_ - 1]; | 560 previousStep = this.currentFlow_[this.currentStepIndex_ - 1]; |
| 561 | 561 |
| 562 if (previousStep) | 562 if (previousStep) |
| 563 document.getElementById(previousStep).hidden = true; | 563 $(previousStep).hidden = true; |
| 564 | 564 |
| 565 chrome.app.window.current().show(); | 565 chrome.app.window.current().show(); |
| 566 }; | 566 }; |
| 567 | 567 |
| 568 window.Flow = Flow; | 568 window.Flow = Flow; |
| 569 })(); | 569 })(); |
| OLD | NEW |