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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 /** | 104 /** |
105 * @param {remoting.ClientSession} clientSession The client session, or null if | 105 * @param {remoting.ClientSession} clientSession The client session, or null if |
106 * there is no connection. | 106 * there is no connection. |
107 */ | 107 */ |
108 remoting.WindowFrame.prototype.setClientSession = function(clientSession) { | 108 remoting.WindowFrame.prototype.setClientSession = function(clientSession) { |
109 this.optionsMenu_.setClientSession(clientSession); | 109 this.optionsMenu_.setClientSession(clientSession); |
110 this.clientSession_ = clientSession; | 110 this.clientSession_ = clientSession; |
111 var windowTitle = document.head.querySelector('title'); | 111 var windowTitle = document.head.querySelector('title'); |
112 if (this.clientSession_) { | 112 if (this.clientSession_) { |
113 document.body.classList.add('connected'); | |
114 this.title_.innerText = clientSession.getHostDisplayName(); | 113 this.title_.innerText = clientSession.getHostDisplayName(); |
115 windowTitle.innerText = clientSession.getHostDisplayName() + ' - ' + | 114 windowTitle.innerText = clientSession.getHostDisplayName() + ' - ' + |
116 chrome.i18n.getMessage(/*i18n-content*/'PRODUCT_NAME'); | 115 chrome.i18n.getMessage(/*i18n-content*/'PRODUCT_NAME'); |
117 } else { | 116 } else { |
118 document.body.classList.remove('connected'); | |
119 this.title_.innerHTML = ' '; | 117 this.title_.innerHTML = ' '; |
120 windowTitle.innerText = | 118 windowTitle.innerText = |
121 chrome.i18n.getMessage(/*i18n-content*/'PRODUCT_NAME'); | 119 chrome.i18n.getMessage(/*i18n-content*/'PRODUCT_NAME'); |
122 } | 120 } |
123 this.updateMaximizeOrRestoreIconTitle_(); | 121 this.updateMaximizeOrRestoreIconTitle_(); |
124 }; | 122 }; |
125 | 123 |
126 /** | 124 /** |
127 * @return {{width: number, height: number}} The size of the window, ignoring | 125 * @return {{width: number, height: number}} The size of the window, ignoring |
128 * the title-bar and window borders, if visible. | 126 * the title-bar and window borders, if visible. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 var hidePreview = function() { | 239 var hidePreview = function() { |
242 target.classList.remove('preview'); | 240 target.classList.remove('preview'); |
243 }; | 241 }; |
244 target.classList.add('preview'); | 242 target.classList.add('preview'); |
245 window.setTimeout(hidePreview, kPreviewTimeoutMs); | 243 window.setTimeout(hidePreview, kPreviewTimeoutMs); |
246 }; | 244 }; |
247 | 245 |
248 | 246 |
249 /** @type {remoting.WindowFrame} */ | 247 /** @type {remoting.WindowFrame} */ |
250 remoting.windowFrame = null; | 248 remoting.windowFrame = null; |
OLD | NEW |