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

Unified Diff: remoting/webapp/app_remoting/js/application_context_menu.js

Issue 1089493002: [Webapp Refactor] Re-add remoting.ConnectionStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/app_remoting/js/app_connected_view.js ('k') | remoting/webapp/crd/html/window_frame.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
};
« no previous file with comments | « remoting/webapp/app_remoting/js/app_connected_view.js ('k') | remoting/webapp/crd/html/window_frame.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698