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 * Apps v2 custom title bar implementation | 7 * Apps v2 custom title bar implementation |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 /** @type {boolean} */ | 124 /** @type {boolean} */ |
125 var restore = | 125 var restore = |
126 chrome.app.window.current().isFullscreen() || | 126 chrome.app.window.current().isFullscreen() || |
127 chrome.app.window.current().isMaximized(); | 127 chrome.app.window.current().isMaximized(); |
128 if (restore) { | 128 if (restore) { |
129 // Restore twice: once to exit full-screen and once to exit maximized. | 129 // Restore twice: once to exit full-screen and once to exit maximized. |
130 // If the app is not full-screen, or went full-screen without first | 130 // If the app is not full-screen, or went full-screen without first |
131 // being maximized, then the second restore has no effect. | 131 // being maximized, then the second restore has no effect. |
132 chrome.app.window.current().restore(); | 132 chrome.app.window.current().restore(); |
133 chrome.app.window.current().restore(); | 133 chrome.app.window.current().restore(); |
| 134 } else if (this.isConnected_) { |
| 135 chrome.app.window.current().fullscreen(); |
134 } else { | 136 } else { |
135 chrome.app.window.current().maximize(); | 137 chrome.app.window.current().maximize(); |
136 } | 138 } |
137 }; | 139 }; |
138 | 140 |
139 /** | 141 /** |
140 * @private | 142 * @private |
141 */ | 143 */ |
142 remoting.WindowFrame.prototype.minimizeWindow_ = function() { | 144 remoting.WindowFrame.prototype.minimizeWindow_ = function() { |
143 chrome.app.window.current().minimize(); | 145 chrome.app.window.current().minimize(); |
(...skipping 21 matching lines...) Expand all Loading... |
165 tag = /*i18n-content*/'RESTORE_WINDOW'; | 167 tag = /*i18n-content*/'RESTORE_WINDOW'; |
166 } else if (this.isConnected_) { | 168 } else if (this.isConnected_) { |
167 tag = /*i18n-content*/'FULL_SCREEN'; | 169 tag = /*i18n-content*/'FULL_SCREEN'; |
168 } else { | 170 } else { |
169 tag = /*i18n-content*/'MAXIMIZE_WINDOW'; | 171 tag = /*i18n-content*/'MAXIMIZE_WINDOW'; |
170 } | 172 } |
171 this.maximizeRestoreControl_.title = l10n.getTranslationOrError(tag); | 173 this.maximizeRestoreControl_.title = l10n.getTranslationOrError(tag); |
172 }; | 174 }; |
173 | 175 |
174 /** @type {remoting.WindowFrame} */ | 176 /** @type {remoting.WindowFrame} */ |
175 remoting.windowFrame = null; | 177 remoting.windowFrame = null; |
OLD | NEW |