OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * Implements a basic UX control for a connected app remoting session. | 7 * Implements a basic UX control for a connected app remoting session. |
8 */ | 8 */ |
9 | 9 |
10 /** @suppress {duplicate} */ | 10 /** @suppress {duplicate} */ |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 /** @private {remoting.ContextMenuAdapter} */ | 44 /** @private {remoting.ContextMenuAdapter} */ |
45 var menuAdapter = new remoting.ContextMenuChrome(); | 45 var menuAdapter = new remoting.ContextMenuChrome(); |
46 | 46 |
47 // Initialize the context menus. | 47 // Initialize the context menus. |
48 if (!remoting.platformIsChromeOS()) { | 48 if (!remoting.platformIsChromeOS()) { |
49 menuAdapter = | 49 menuAdapter = |
50 new remoting.ContextMenuDom(document.getElementById('context-menu')); | 50 new remoting.ContextMenuDom(document.getElementById('context-menu')); |
51 } | 51 } |
52 | 52 |
53 this.contextMenu_ = | 53 this.contextMenu_ = new remoting.ApplicationContextMenu( |
54 new remoting.ApplicationContextMenu(menuAdapter, this.plugin_); | 54 menuAdapter, this.plugin_, connectionInfo.session()); |
55 this.contextMenu_.setHostId(connectionInfo.host().hostId); | 55 this.contextMenu_.setHostId(connectionInfo.host().hostId); |
56 | 56 |
57 /** @private */ | 57 /** @private */ |
58 this.keyboardLayoutsMenu_ = new remoting.KeyboardLayoutsMenu(menuAdapter); | 58 this.keyboardLayoutsMenu_ = new remoting.KeyboardLayoutsMenu(menuAdapter); |
59 | 59 |
60 /** @private */ | 60 /** @private */ |
61 this.windowActivationMenu_ = new remoting.WindowActivationMenu(menuAdapter); | 61 this.windowActivationMenu_ = new remoting.WindowActivationMenu(menuAdapter); |
62 | 62 |
63 var baseView = new remoting.ConnectedView( | 63 var baseView = new remoting.ConnectedView( |
64 this.plugin_, containerElement, | 64 this.plugin_, containerElement, |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 ]; | 239 ]; |
240 remoting.identity.getNewToken(googleDriveScopes).then( | 240 remoting.identity.getNewToken(googleDriveScopes).then( |
241 function(/** string */ token){ | 241 function(/** string */ token){ |
242 sendExtensionMessage('accessToken', token); | 242 sendExtensionMessage('accessToken', token); |
243 }).catch(remoting.Error.handler(function(/** remoting.Error */ error) { | 243 }).catch(remoting.Error.handler(function(/** remoting.Error */ error) { |
244 console.log('Failed to refresh access token: ' + error.toString()); | 244 console.log('Failed to refresh access token: ' + error.toString()); |
245 })); | 245 })); |
246 }; | 246 }; |
247 | 247 |
248 })(); | 248 })(); |
OLD | NEW |