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 /** Idle time in ms before the UI is hidden. */ | 7 /** Idle time in ms before the UI is hidden. */ |
8 var HIDE_TIMEOUT = 2000; | 8 var HIDE_TIMEOUT = 2000; |
9 /** Time in ms after force hide before toolbar is shown again. */ | 9 /** Time in ms after force hide before toolbar is shown again. */ |
10 var FORCE_HIDE_TIMEOUT = 1000; | 10 var FORCE_HIDE_TIMEOUT = 1000; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 if (interval != 0) | 130 if (interval != 0) |
131 return movement / interval > SHOW_VELOCITY; | 131 return movement / interval > SHOW_VELOCITY; |
132 } | 132 } |
133 } | 133 } |
134 return false; | 134 return false; |
135 }, | 135 }, |
136 | 136 |
137 /** | 137 /** |
138 * Wrapper around Date.now() to make it easily replaceable for testing. | 138 * Wrapper around Date.now() to make it easily replaceable for testing. |
139 * @return {int} | 139 * @return {number} |
140 * @private | 140 * @private |
141 */ | 141 */ |
142 getCurrentTimestamp_: function() { | 142 getCurrentTimestamp_: function() { |
143 return Date.now(); | 143 return Date.now(); |
144 }, | 144 }, |
145 | 145 |
146 /** | 146 /** |
147 * Display both UI toolbars. | 147 * Display both UI toolbars. |
148 */ | 148 */ |
149 showToolbars: function() { | 149 showToolbars: function() { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 * the UI. | 243 * the UI. |
244 * @private | 244 * @private |
245 */ | 245 */ |
246 resizeDropdowns_: function() { | 246 resizeDropdowns_: function() { |
247 if (!this.toolbar_) | 247 if (!this.toolbar_) |
248 return; | 248 return; |
249 var lowerBound = this.window_.innerHeight - this.zoomToolbar_.clientHeight; | 249 var lowerBound = this.window_.innerHeight - this.zoomToolbar_.clientHeight; |
250 this.toolbar_.setDropdownLowerBound(lowerBound); | 250 this.toolbar_.setDropdownLowerBound(lowerBound); |
251 } | 251 } |
252 }; | 252 }; |
OLD | NEW |