| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Module to support debug overlay window with connection stats. | 7 * Module to support debug overlay window with connection stats. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 * Show or hide the connection stats div. | 51 * Show or hide the connection stats div. |
| 52 * @param {boolean} show | 52 * @param {boolean} show |
| 53 */ | 53 */ |
| 54 remoting.ConnectionStats.prototype.show = function(show) { | 54 remoting.ConnectionStats.prototype.show = function(show) { |
| 55 this.statsElement_.hidden = !show; | 55 this.statsElement_.hidden = !show; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * If the stats panel is visible, add its bounding rectangle to the specified | 59 * If the stats panel is visible, add its bounding rectangle to the specified |
| 60 * region. | 60 * region. |
| 61 * @param {Array.<{left: number, top: number, width: number, height: number}>} | 61 * @param {Array<{left: number, top: number, width: number, height: number}>} |
| 62 * rects List of rectangles. | 62 * rects List of rectangles. |
| 63 */ | 63 */ |
| 64 | 64 |
| 65 remoting.ConnectionStats.prototype.addToRegion = function(rects) { | 65 remoting.ConnectionStats.prototype.addToRegion = function(rects) { |
| 66 if (!this.statsElement_.hidden) { | 66 if (!this.statsElement_.hidden) { |
| 67 rects.push(this.statsElement_.getBoundingClientRect()); | 67 rects.push(this.statsElement_.getBoundingClientRect()); |
| 68 } | 68 } |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 /** | 71 /** |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 if (element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') { | 126 if (element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') { |
| 127 return; | 127 return; |
| 128 } | 128 } |
| 129 if (String.fromCharCode(event.which) == 'D') { | 129 if (String.fromCharCode(event.which) == 'D') { |
| 130 remoting.stats.toggle(); | 130 remoting.stats.toggle(); |
| 131 } | 131 } |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 /** @type {remoting.ConnectionStats} */ | 134 /** @type {remoting.ConnectionStats} */ |
| 135 remoting.stats = null; | 135 remoting.stats = null; |
| OLD | NEW |