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'; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 }; | 96 }; |
97 | 97 |
98 /** @type {remoting.ApplicationContextMenu} */ | 98 /** @type {remoting.ApplicationContextMenu} */ |
99 var that = this; | 99 var that = this; |
100 | 100 |
101 /** @param {chrome.app.window.AppWindow} consentWindow */ | 101 /** @param {chrome.app.window.AppWindow} consentWindow */ |
102 var onCreate = function(consentWindow) { | 102 var onCreate = function(consentWindow) { |
103 var onLoad = function() { | 103 var onLoad = function() { |
104 var message = { | 104 var message = { |
105 method: 'init', | 105 method: 'init', |
| 106 appId: remoting.app.getApplicationId(), |
106 hostId: that.hostId_, | 107 hostId: that.hostId_, |
107 connectionStats: JSON.stringify(that.stats_.mostRecent()), | 108 connectionStats: JSON.stringify(that.stats_.mostRecent()), |
108 sessionId: that.clientSession_.getLogger().getSessionId() | 109 sessionId: that.clientSession_.getLogger().getSessionId() |
109 }; | 110 }; |
110 consentWindow.contentWindow.postMessage(message, '*'); | 111 consentWindow.contentWindow.postMessage(message, '*'); |
111 }; | 112 }; |
112 consentWindow.contentWindow.addEventListener('load', onLoad, false); | 113 consentWindow.contentWindow.addEventListener('load', onLoad, false); |
113 }; | 114 }; |
114 chrome.app.window.create( | 115 chrome.app.window.create( |
115 'feedback_consent.html', windowAttributes, onCreate); | 116 'feedback_consent.html', windowAttributes, onCreate); |
116 break; | 117 break; |
117 | 118 |
118 case remoting.ApplicationContextMenu.kShowStatsId: | 119 case remoting.ApplicationContextMenu.kShowStatsId: |
119 this.stats_.show(info.checked); | 120 this.stats_.show(info.checked); |
120 break; | 121 break; |
121 } | 122 } |
122 }; | 123 }; |
123 | 124 |
124 | 125 |
125 /** @type {string} */ | 126 /** @type {string} */ |
126 remoting.ApplicationContextMenu.kSendFeedbackId = 'send-feedback'; | 127 remoting.ApplicationContextMenu.kSendFeedbackId = 'send-feedback'; |
127 | 128 |
128 /** @type {string} */ | 129 /** @type {string} */ |
129 remoting.ApplicationContextMenu.kShowStatsId = 'show-stats'; | 130 remoting.ApplicationContextMenu.kShowStatsId = 'show-stats'; |
OLD | NEW |