Chromium Code Reviews| Index: remoting/webapp/app_remoting/js/application_context_menu.js |
| diff --git a/remoting/webapp/app_remoting/js/application_context_menu.js b/remoting/webapp/app_remoting/js/application_context_menu.js |
| index 2ba7937dae0f313d29db0f792db6c8240cc7ef80..076c1cea63b3bab2b4753cc768d9e84a23d46119 100644 |
| --- a/remoting/webapp/app_remoting/js/application_context_menu.js |
| +++ b/remoting/webapp/app_remoting/js/application_context_menu.js |
| @@ -14,9 +14,10 @@ var remoting = remoting || {}; |
| /** |
| * @param {remoting.ContextMenuAdapter} adapter |
| + * @param {remoting.ClientPlugin} plugin |
| * @constructor |
| */ |
| -remoting.ApplicationContextMenu = function(adapter) { |
| +remoting.ApplicationContextMenu = function(adapter, plugin) { |
| /** @private {remoting.ContextMenuAdapter} */ |
| this.adapter_ = adapter; |
| @@ -28,10 +29,16 @@ remoting.ApplicationContextMenu = function(adapter) { |
| remoting.ApplicationContextMenu.kShowStatsId, |
| l10n.getTranslationOrError(/*i18n-content*/'SHOW_STATS'), |
| true); |
| + |
| + // TODO(kelvinp):Unhook this event on shutdown. |
|
Jamie
2015/04/15 17:02:47
I don't think this is necessary. If an in-DOM cont
kelvinp
2015/04/15 18:37:50
I think we should still clean up event listeners o
Jamie
2015/04/15 18:40:47
Acknowledged.
|
| this.adapter_.addListener(this.onClicked_.bind(this)); |
| /** @private {string} */ |
| this.hostId_ = ''; |
| + |
| + /** @private */ |
| + this.stats_ = new remoting.ConnectionStats( |
| + document.getElementById('statistics'), plugin); |
|
Jamie
2015/04/15 17:02:47
You're never calling dispose() on this. Does that
kelvinp
2015/04/15 18:37:50
Good catch. Done.
|
| }; |
| /** |
| @@ -39,7 +46,7 @@ remoting.ApplicationContextMenu = function(adapter) { |
| */ |
| remoting.ApplicationContextMenu.prototype.setHostId = function(hostId) { |
| this.hostId_ = hostId; |
| -} |
| +}; |
| /** |
| * Add an indication of the connection RTT to the 'Show statistics' menu item. |
| @@ -92,9 +99,7 @@ remoting.ApplicationContextMenu.prototype.onClicked_ = function(info) { |
| break; |
| case remoting.ApplicationContextMenu.kShowStatsId: |
| - if (remoting.stats) { |
| - remoting.stats.show(info.checked); |
| - } |
| + this.stats_.show(info.checked); |
| break; |
| } |
| }; |