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

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

Issue 1816653002: Remove app_remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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
deleted file mode 100644
index a7934c07df9106063b850a3e2dfcf7945d7339a0..0000000000000000000000000000000000000000
--- a/remoting/webapp/app_remoting/js/application_context_menu.js
+++ /dev/null
@@ -1,150 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview
- * Class representing the application's context menu.
- */
-
-'use strict';
-
-/** @suppress {duplicate} */
-var remoting = remoting || {};
-
-/**
- * @param {remoting.ContextMenuAdapter} adapter
- * @param {remoting.ClientPlugin} plugin
- * @param {remoting.ClientSession} clientSession
- * @param {remoting.WindowShape} windowShape
- *
- * @constructor
- * @implements {base.Disposable}
- */
-remoting.ApplicationContextMenu = function(adapter, plugin, clientSession,
- windowShape) {
- /** @private */
- this.adapter_ = adapter;
-
- /** @private */
- this.clientSession_ = clientSession;
-
- this.adapter_.create(
- remoting.ApplicationContextMenu.kSendFeedbackId,
- l10n.getTranslationOrError(/*i18n-content*/'SEND_FEEDBACK'),
- false);
- this.adapter_.create(
- remoting.ApplicationContextMenu.kShowStatsId,
- l10n.getTranslationOrError(/*i18n-content*/'SHOW_STATS'),
- true);
- this.adapter_.create(
- remoting.ApplicationContextMenu.kShowCreditsId,
- l10n.getTranslationOrError(/*i18n-content*/'CREDITS'),
- true);
-
- // TODO(kelvinp):Unhook this event on shutdown.
- this.adapter_.addListener(this.onClicked_.bind(this));
-
- /** @private {string} */
- this.hostId_ = '';
-
- /** @private */
- this.stats_ = new remoting.ConnectionStats(
- document.getElementById('statistics'), plugin, windowShape);
-};
-
-remoting.ApplicationContextMenu.prototype.dispose = function() {
- base.dispose(this.stats_);
- this.stats_ = null;
-};
-
-/**
- * @param {string} hostId
- */
-remoting.ApplicationContextMenu.prototype.setHostId = function(hostId) {
- this.hostId_ = hostId;
-};
-
-/**
- * Add an indication of the connection RTT to the 'Show statistics' menu item.
- *
- * @param {number} rttMs The RTT of the connection, in ms.
- */
-remoting.ApplicationContextMenu.prototype.updateConnectionRTT =
- function(rttMs) {
- var rttText =
- rttMs < 50 ? /*i18n-content*/'CONNECTION_QUALITY_GOOD' :
- rttMs < 100 ? /*i18n-content*/'CONNECTION_QUALITY_FAIR' :
- /*i18n-content*/'CONNECTION_QUALITY_POOR';
- rttText = l10n.getTranslationOrError(rttText);
- this.adapter_.updateTitle(
- remoting.ApplicationContextMenu.kShowStatsId,
- l10n.getTranslationOrError(/*i18n-content*/'SHOW_STATS_WITH_RTT',
- rttText));
-};
-
-/** @param {OnClickData=} info */
-remoting.ApplicationContextMenu.prototype.onClicked_ = function(info) {
- var menuId = /** @type {string} */ (info.menuItemId.toString());
- switch (menuId) {
-
- case remoting.ApplicationContextMenu.kSendFeedbackId:
- var windowAttributes = {
- bounds: {
- width: 400,
- height: 100,
- left: undefined,
- top: undefined
- },
- resizable: false
- };
-
- /** @type {remoting.ApplicationContextMenu} */
- var that = this;
-
- /** @param {chrome.app.window.AppWindow} consentWindow */
- var onCreate = function(consentWindow) {
- var onLoad = function() {
- var message = {
- method: 'init',
- appId: remoting.app.getApplicationId(),
- hostId: that.hostId_,
- connectionStats: JSON.stringify(that.stats_.mostRecent()),
- sessionId: that.clientSession_.getLogger().getSessionId(),
- consoleErrors: JSON.stringify(
- remoting.ConsoleWrapper.getInstance().getHistory())
- };
- consentWindow.contentWindow.postMessage(message, '*');
- };
- consentWindow.contentWindow.addEventListener('load', onLoad, false);
- };
- chrome.app.window.create(
- '_modules/koejkfhmphamcgafjmkellhnekdkopod/feedback_consent.html',
- windowAttributes, onCreate);
- break;
-
- case remoting.ApplicationContextMenu.kShowStatsId:
- this.stats_.show(info.checked);
- break;
-
- case remoting.ApplicationContextMenu.kShowCreditsId:
- chrome.app.window.create(
- '_modules/koejkfhmphamcgafjmkellhnekdkopod/credits.html',
- {
- 'width': 800,
- 'height': 600,
- 'id' : 'remoting-credits'
- });
- break;
- }
-};
-
-
-/** @type {string} */
-remoting.ApplicationContextMenu.kSendFeedbackId = 'send-feedback';
-
-/** @type {string} */
-remoting.ApplicationContextMenu.kShowStatsId = 'show-stats';
-
-/** @type {string} */
-remoting.ApplicationContextMenu.kShowCreditsId = 'show-credits';
« no previous file with comments | « remoting/webapp/app_remoting/js/app_remoting_activity.js ('k') | remoting/webapp/app_remoting/js/ar_auth_dialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698