 Chromium Code Reviews
 Chromium Code Reviews Issue 1011283003:
  Hotword: Make the opt-in flow tab ordering more intuitive  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1011283003:
  Hotword: Make the opt-in flow tab ordering more intuitive  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 538 $('intro-description-audio-history-enabled').hidden = false; | 538 $('intro-description-audio-history-enabled').hidden = false; | 
| 539 } else if (state.launchMode == LaunchMode.HOTWORD_AND_AUDIO_HISTORY) { | 539 } else if (state.launchMode == LaunchMode.HOTWORD_AND_AUDIO_HISTORY) { | 
| 540 $('intro-description').hidden = false; | 540 $('intro-description').hidden = false; | 
| 541 } | 541 } | 
| 542 | 542 | 
| 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. | 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 currentStep = this.currentFlow_[this.currentStepIndex_]; | 552 var currentStepId = this.currentFlow_[this.currentStepIndex_]; | 
| 553 document.getElementById(currentStep).hidden = false; | 553 var currentStep = document.getElementById(currentStepId); | 
| 554 currentStep.hidden = false; | |
| 555 | |
| 556 cr.ui.setInitialFocus(currentStep.querySelector('.buttonbar')); | |
| 
Dan Beam
2015/03/19 02:38:47
this kinda defeats the purpose.  you should be pas
 
kcarattini
2015/03/19 02:59:39
Done.
 | |
| 554 | 557 | 
| 555 var previousStep = null; | 558 var previousStep = null; | 
| 556 if (this.currentStepIndex_ > 0) | 559 if (this.currentStepIndex_ > 0) | 
| 557 previousStep = this.currentFlow_[this.currentStepIndex_ - 1]; | 560 previousStep = this.currentFlow_[this.currentStepIndex_ - 1]; | 
| 558 | 561 | 
| 559 if (previousStep) | 562 if (previousStep) | 
| 560 document.getElementById(previousStep).hidden = true; | 563 document.getElementById(previousStep).hidden = true; | 
| 561 | 564 | 
| 562 chrome.app.window.current().show(); | 565 chrome.app.window.current().show(); | 
| 563 }; | 566 }; | 
| 564 | 567 | 
| 565 window.Flow = Flow; | 568 window.Flow = Flow; | 
| 566 })(); | 569 })(); | 
| OLD | NEW |