| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * Class to update the application's context menu to include host-side windows | 7 * Class to update the application's context menu to include host-side windows |
| 8 * and to notify the host when one of these menu items is selected. | 8 * and to notify the host when one of these menu items is selected. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 'use strict'; | 11 'use strict'; |
| 12 | 12 |
| 13 /** @suppress {duplicate} */ | 13 /** @suppress {duplicate} */ |
| 14 var remoting = remoting || {}; | 14 var remoting = remoting || {}; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * @param {remoting.ContextMenuAdapter} adapter | 17 * @param {remoting.ContextMenuAdapter} adapter |
| 18 * @constructor | 18 * @constructor |
| 19 */ | 19 */ |
| 20 remoting.WindowActivationMenu = function(adapter) { | 20 remoting.WindowActivationMenu = function(adapter) { |
| 21 /** | 21 /** @private {remoting.SubmenuManager} */ |
| 22 * @type {remoting.SubmenuManager} | |
| 23 * @private | |
| 24 */ | |
| 25 this.submenuManager_ = new remoting.SubmenuManager( | 22 this.submenuManager_ = new remoting.SubmenuManager( |
| 26 adapter, | 23 adapter, |
| 27 chrome.i18n.getMessage(/*i18n-content*/'WINDOWS_SUBMENU_TITLE'), | 24 chrome.i18n.getMessage(/*i18n-content*/'WINDOWS_SUBMENU_TITLE'), |
| 28 false); | 25 false); |
| 29 | 26 |
| 30 adapter.addListener(this.onContextMenu_.bind(this)); | 27 adapter.addListener(this.onContextMenu_.bind(this)); |
| 31 }; | 28 }; |
| 32 | 29 |
| 33 /** | 30 /** |
| 34 * Add a window to the application's context menu, or update the title of an | 31 * Add a window to the application's context menu, or update the title of an |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 if (components.length == 2 && | 72 if (components.length == 2 && |
| 76 this.makeMenuId_(parseInt(components[1], 10)) == info.menuItemId) { | 73 this.makeMenuId_(parseInt(components[1], 10)) == info.menuItemId) { |
| 77 remoting.clientSession.sendClientMessage( | 74 remoting.clientSession.sendClientMessage( |
| 78 'activateWindow', | 75 'activateWindow', |
| 79 JSON.stringify({ id: parseInt(components[1], 0) })); | 76 JSON.stringify({ id: parseInt(components[1], 0) })); |
| 80 if (chrome.app.window.current().isMinimized()) { | 77 if (chrome.app.window.current().isMinimized()) { |
| 81 chrome.app.window.current().restore(); | 78 chrome.app.window.current().restore(); |
| 82 } | 79 } |
| 83 } | 80 } |
| 84 }; | 81 }; |
| OLD | NEW |