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 representing the application's context menu. | 7 * Class representing the application's context menu. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
11 | 11 |
12 /** @suppress {duplicate} */ | 12 /** @suppress {duplicate} */ |
13 var remoting = remoting || {}; | 13 var remoting = remoting || {}; |
14 | 14 |
15 /** | 15 /** |
16 * @param {remoting.ContextMenuAdapter} adapter | 16 * @param {remoting.ContextMenuAdapter} adapter |
17 * @constructor | 17 * @constructor |
18 */ | 18 */ |
19 remoting.ApplicationContextMenu = function(adapter) { | 19 remoting.ApplicationContextMenu = function(adapter) { |
20 /** | 20 /** @private {remoting.ContextMenuAdapter} */ |
21 * @type {remoting.ContextMenuAdapter} | |
22 * @private | |
23 */ | |
24 this.adapter_ = adapter; | 21 this.adapter_ = adapter; |
25 | 22 |
26 this.adapter_.create( | 23 this.adapter_.create( |
27 remoting.ApplicationContextMenu.kSendFeedbackId, | 24 remoting.ApplicationContextMenu.kSendFeedbackId, |
28 l10n.getTranslationOrError(/*i18n-content*/'SEND_FEEDBACK'), | 25 l10n.getTranslationOrError(/*i18n-content*/'SEND_FEEDBACK'), |
29 false); | 26 false); |
30 this.adapter_.create( | 27 this.adapter_.create( |
31 remoting.ApplicationContextMenu.kShowStatsId, | 28 remoting.ApplicationContextMenu.kShowStatsId, |
32 l10n.getTranslationOrError(/*i18n-content*/'SHOW_STATS'), | 29 l10n.getTranslationOrError(/*i18n-content*/'SHOW_STATS'), |
33 true); | 30 true); |
34 this.adapter_.addListener(this.onClicked_.bind(this)); | 31 this.adapter_.addListener(this.onClicked_.bind(this)); |
35 | 32 |
36 /** | 33 /** @private {string} */ |
37 * @type {string} | |
38 * @private | |
39 */ | |
40 this.hostId_ = ''; | 34 this.hostId_ = ''; |
41 }; | 35 }; |
42 | 36 |
43 /** | 37 /** |
44 * @param {string} hostId | 38 * @param {string} hostId |
45 */ | 39 */ |
46 remoting.ApplicationContextMenu.prototype.setHostId = function(hostId) { | 40 remoting.ApplicationContextMenu.prototype.setHostId = function(hostId) { |
47 this.hostId_ = hostId; | 41 this.hostId_ = hostId; |
48 } | 42 } |
49 | 43 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 break; | 98 break; |
105 } | 99 } |
106 }; | 100 }; |
107 | 101 |
108 | 102 |
109 /** @type {string} */ | 103 /** @type {string} */ |
110 remoting.ApplicationContextMenu.kSendFeedbackId = 'send-feedback'; | 104 remoting.ApplicationContextMenu.kSendFeedbackId = 'send-feedback'; |
111 | 105 |
112 /** @type {string} */ | 106 /** @type {string} */ |
113 remoting.ApplicationContextMenu.kShowStatsId = 'show-stats'; | 107 remoting.ApplicationContextMenu.kShowStatsId = 'show-stats'; |
OLD | NEW |