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

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

Issue 671333002: Hotword Audio Verification App: Fix window handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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 (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';
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 this.advanceStep(); 66 this.advanceStep();
67 }; 67 };
68 68
69 /** 69 /**
70 * Displays the current step. If the current step is not the first step, 70 * Displays the current step. If the current step is not the first step,
71 * also hides the previous step. 71 * also hides the previous step.
72 * @private 72 * @private
73 */ 73 */
74 Flow.prototype.showStep_ = function() { 74 Flow.prototype.showStep_ = function() {
75 var currentStep = this.currentFlow_[this.currentStepIndex_]; 75 var currentStep = this.currentFlow_[this.currentStepIndex_];
76 document.getElementById(currentStep).hidden = false;
77
76 var previousStep = null; 78 var previousStep = null;
77 if (this.currentStepIndex_ > 0) 79 if (this.currentStepIndex_ > 0)
78 previousStep = this.currentFlow_[this.currentStepIndex_ - 1]; 80 previousStep = this.currentFlow_[this.currentStepIndex_ - 1];
79 81
80 if (previousStep) 82 if (previousStep)
81 document.getElementById(previousStep).hidden = true; 83 document.getElementById(previousStep).hidden = true;
82 84
83 document.getElementById(currentStep).hidden = false; 85 var appWindow = chrome.app.window.current();
86 if (appWindow)
Dan Beam 2014/10/27 23:13:20 this doesn't answer my question as I don't know wh
kcarattini 2014/10/27 23:24:12 There should always be an app window in this conte
Dan Beam 2014/10/27 23:29:20 then please leave the code as it was so we can cat
kcarattini 2014/10/27 23:57:20 Done. Sorry, I misunderstood your earlier question
87 appWindow.show();
84 }; 88 };
85 89
86 window.Flow = Flow; 90 window.Flow = Flow;
87 })(); 91 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698