| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 */ | 115 */ |
| 116 remoting.AppConnectedView.prototype.onDesktopSizeChanged_ = | 116 remoting.AppConnectedView.prototype.onDesktopSizeChanged_ = |
| 117 function(hostDesktop) { | 117 function(hostDesktop) { |
| 118 // The first desktop size change indicates that we can close the loading | 118 // The first desktop size change indicates that we can close the loading |
| 119 // window. | 119 // window. |
| 120 remoting.LoadingWindow.close(); | 120 remoting.LoadingWindow.close(); |
| 121 | 121 |
| 122 var hostSize = { width: hostDesktop.width, height: hostDesktop.height }; | 122 var hostSize = { width: hostDesktop.width, height: hostDesktop.height }; |
| 123 var hostDpi = { x: hostDesktop.xDpi, y: hostDesktop.yDpi }; | 123 var hostDpi = { x: hostDesktop.xDpi, y: hostDesktop.yDpi }; |
| 124 var clientArea = { width: window.innerWidth, height: window.innerHeight }; | 124 var clientArea = { width: window.innerWidth, height: window.innerHeight }; |
| 125 var newSize = remoting.DesktopViewport.choosePluginSize( | 125 var newSize = remoting.Viewport.choosePluginSize( |
| 126 clientArea, window.devicePixelRatio, | 126 clientArea, window.devicePixelRatio, |
| 127 hostSize, hostDpi, this.host_.options.desktopScale, | 127 hostSize, hostDpi, this.host_.options.desktopScale, |
| 128 true /* fullscreen */ , true /* shrinkToFit */ ); | 128 true /* fullscreen */ , true /* shrinkToFit */ ); |
| 129 | 129 |
| 130 this.plugin_.element().style.width = newSize.width + 'px'; | 130 this.plugin_.element().style.width = newSize.width + 'px'; |
| 131 this.plugin_.element().style.height = newSize.height + 'px'; | 131 this.plugin_.element().style.height = newSize.height + 'px'; |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 /** | 134 /** |
| 135 * @return {Array<string>} | 135 * @return {Array<string>} |
| (...skipping 103 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 |