Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 var HIDE_TIMEOUT = 2000; | 7 var HIDE_TIMEOUT = 2000; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Creates a UI Manager to handle transitioning of toolbars and panes. | 10 * Creates a UI Manager to handle transitioning of toolbars and panes. |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 UiManager.prototype = { | 28 UiManager.prototype = { |
| 29 /** | 29 /** |
| 30 * @private | 30 * @private |
| 31 * Display the toolbar and any pane that was previously opened. | 31 * Display the toolbar and any pane that was previously opened. |
| 32 */ | 32 */ |
| 33 showUi_: function() { | 33 showUi_: function() { |
| 34 this.toolbar_.show(); | 34 this.toolbar_.show(); |
| 35 for (var i = 0; i < this.panes_.length; i++) | 35 for (var i = 0; i < this.panes_.length; i++) |
| 36 this.panes_[i].showIfOpenedByUser(); | 36 this.panes_[i].showIfOpenedByUser(); |
| 37 | 37 |
| 38 if (this.uiTimeout_) | 38 this.hideUiAfterTimeout(); |
| 39 clearTimeout(this.uiTimeout_); | |
| 40 this.uiTimeout_ = setTimeout(this.hideUi_.bind(this), HIDE_TIMEOUT); | |
| 41 }, | 39 }, |
| 42 | 40 |
| 43 /** | 41 /** |
| 44 * @private | 42 * @private |
| 45 * Hide the toolbar and any pane that was previously opened. | 43 * Hide the toolbar and any pane that was previously opened. |
| 46 */ | 44 */ |
| 47 hideUi_: function() { | 45 hideUi_: function() { |
| 48 this.toolbar_.hide(); | 46 this.toolbar_.hide(); |
| 49 for (var i = 0; i < this.panes_.length; i++) | 47 for (var i = 0; i < this.panes_.length; i++) |
| 50 this.panes_[i].hideIfOpenedByUser(); | 48 this.panes_[i].hideIfOpenedByUser(); |
| 49 }, | |
| 50 | |
| 51 /** | |
| 52 * @private | |
|
Sam McNally
2015/03/02 02:25:39
Remove.
| |
| 53 * Hide the toolbar after the HIDE_TIMEOUT has elapsed. | |
| 54 */ | |
| 55 hideUiAfterTimeout: function() { | |
| 56 if (this.uiTimeout_) | |
| 57 clearTimeout(this.uiTimeout_); | |
| 58 this.uiTimeout_ = setTimeout(this.hideUi_.bind(this), HIDE_TIMEOUT); | |
| 51 } | 59 } |
| 52 }; | 60 }; |
| OLD | NEW |