| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 base.debug.assert(this.optionsMenuList_ != null); | 46 base.debug.assert(this.optionsMenuList_ != null); |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * @type {Array<{cls:string, fn: function()}>} | 49 * @type {Array<{cls:string, fn: function()}>} |
| 50 */ | 50 */ |
| 51 var handlers = [ | 51 var handlers = [ |
| 52 { cls: 'window-disconnect', fn: this.disconnectSession_.bind(this) }, | 52 { cls: 'window-disconnect', fn: this.disconnectSession_.bind(this) }, |
| 53 { cls: 'window-maximize-restore', | 53 { cls: 'window-maximize-restore', |
| 54 fn: this.maximizeOrRestoreWindow_.bind(this) }, | 54 fn: this.maximizeOrRestoreWindow_.bind(this) }, |
| 55 { cls: 'window-minimize', fn: this.minimizeWindow_.bind(this) }, | 55 { cls: 'window-minimize', fn: this.minimizeWindow_.bind(this) }, |
| 56 { cls: 'window-close', fn: window.close.bind(window) }, | 56 { cls: 'window-close', fn: remoting.app.exit.bind(remoting.app) }, |
| 57 { cls: 'window-controls-stub', fn: this.toggleWindowControls_.bind(this) } | 57 { cls: 'window-controls-stub', fn: this.toggleWindowControls_.bind(this) } |
| 58 ]; | 58 ]; |
| 59 for (var i = 0; i < handlers.length; ++i) { | 59 for (var i = 0; i < handlers.length; ++i) { |
| 60 var element = titleBar.querySelector('.' + handlers[i].cls); | 60 var element = titleBar.querySelector('.' + handlers[i].cls); |
| 61 base.debug.assert(element != null); | 61 base.debug.assert(element != null); |
| 62 element.addEventListener('click', handlers[i].fn, false); | 62 element.addEventListener('click', handlers[i].fn, false); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Ensure that tool-tips are always correct. | 65 // Ensure that tool-tips are always correct. |
| 66 this.handleWindowStateChange_(); | 66 this.handleWindowStateChange_(); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 var hidePreview = function() { | 226 var hidePreview = function() { |
| 227 target.classList.remove('preview'); | 227 target.classList.remove('preview'); |
| 228 }; | 228 }; |
| 229 target.classList.add('preview'); | 229 target.classList.add('preview'); |
| 230 window.setTimeout(hidePreview, kPreviewTimeoutMs); | 230 window.setTimeout(hidePreview, kPreviewTimeoutMs); |
| 231 }; | 231 }; |
| 232 | 232 |
| 233 | 233 |
| 234 /** @type {remoting.WindowFrame} */ | 234 /** @type {remoting.WindowFrame} */ |
| 235 remoting.windowFrame = null; | 235 remoting.windowFrame = null; |
| OLD | NEW |