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 /** @type {AppWindow} */ | 5 /** @type {AppWindow} */ |
6 var mainWindow = null; | 6 var mainWindow = null; |
7 | 7 |
8 /** | 8 /** |
9 * The main window cannot delete its context menu entries on close because it | 9 * The main window cannot delete its context menu entries on close because it |
10 * is being torn down at that point and doesn't have access to the necessary | 10 * is being torn down at that point and doesn't have access to the necessary |
(...skipping 10 matching lines...) Expand all Loading... |
21 if (mainWindow) { | 21 if (mainWindow) { |
22 mainWindow.focus(); | 22 mainWindow.focus(); |
23 return; | 23 return; |
24 } | 24 } |
25 | 25 |
26 var typed_screen = /** @type {{availWidth: number, availHeight: number}} */ | 26 var typed_screen = /** @type {{availWidth: number, availHeight: number}} */ |
27 (screen); | 27 (screen); |
28 | 28 |
29 var windowAttributes = { | 29 var windowAttributes = { |
30 resizable: false, | 30 resizable: false, |
31 frame: 'none', | 31 frame: remoting.platformIsMac() ? 'chrome' : 'none', |
32 bounds: { | 32 bounds: { |
33 width: typed_screen.availWidth, | 33 width: typed_screen.availWidth, |
34 height: typed_screen.availHeight | 34 height: typed_screen.availHeight |
35 } | 35 } |
36 }; | 36 }; |
37 | 37 |
38 function onClosed() { | 38 function onClosed() { |
39 mainWindow = null; | 39 mainWindow = null; |
40 var ids = Object.keys(contextMenuIds); | 40 var ids = Object.keys(contextMenuIds); |
41 for (var i = 0; i < ids.length; ++i) { | 41 for (var i = 0; i < ids.length; ++i) { |
(...skipping 23 matching lines...) Expand all Loading... |
65 contextMenuIds[id] = true; | 65 contextMenuIds[id] = true; |
66 break; | 66 break; |
67 case 'removeContextMenuId': | 67 case 'removeContextMenuId': |
68 delete contextMenuIds[id]; | 68 delete contextMenuIds[id]; |
69 break; | 69 break; |
70 } | 70 } |
71 }; | 71 }; |
72 | 72 |
73 chrome.app.runtime.onLaunched.addListener(createWindow); | 73 chrome.app.runtime.onLaunched.addListener(createWindow); |
74 window.addEventListener('message', onWindowMessage, false); | 74 window.addEventListener('message', onWindowMessage, false); |
OLD | NEW |