Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(781)

Side by Side Diff: remoting/webapp/toolbar.js

Issue 380053002: Fix remoting.Toolbar.setClientSession() to handle clientSession=null. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 * Class representing the client tool-bar. 7 * Class representing the client tool-bar.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 this.toolbar_.classList.toggle(remoting.Toolbar.VISIBLE_CLASS_); 114 this.toolbar_.classList.toggle(remoting.Toolbar.VISIBLE_CLASS_);
115 }; 115 };
116 116
117 /** 117 /**
118 * @param {remoting.ClientSession} clientSession The active session, or null if 118 * @param {remoting.ClientSession} clientSession The active session, or null if
119 * there is no connection. 119 * there is no connection.
120 */ 120 */
121 remoting.Toolbar.prototype.setClientSession = function(clientSession) { 121 remoting.Toolbar.prototype.setClientSession = function(clientSession) {
122 this.optionsMenu_.setClientSession(clientSession); 122 this.optionsMenu_.setClientSession(clientSession);
123 var connectedTo = document.getElementById('connected-to'); 123 var connectedTo = document.getElementById('connected-to');
124 connectedTo.innerText = clientSession.getHostDisplayName(); 124 connectedTo.innerText =
125 clientSession ? clientSession.getHostDisplayName() : "";
125 }; 126 };
126 127
127 /** 128 /**
128 * Test the specified co-ordinate to see if it is close enough to the stub 129 * Test the specified co-ordinate to see if it is close enough to the stub
129 * to activate it. 130 * to activate it.
130 * 131 *
131 * @param {number} x The x co-ordinate. 132 * @param {number} x The x co-ordinate.
132 * @param {number} y The y co-ordinate. 133 * @param {number} y The y co-ordinate.
133 * @return {boolean} True if the position should activate the tool-bar stub, or 134 * @return {boolean} True if the position should activate the tool-bar stub, or
134 * false otherwise. 135 * false otherwise.
(...skipping 28 matching lines...) Expand all
163 } 164 }
164 }; 165 };
165 166
166 /** @type {remoting.Toolbar} */ 167 /** @type {remoting.Toolbar} */
167 remoting.toolbar = null; 168 remoting.toolbar = null;
168 169
169 /** @private */ 170 /** @private */
170 remoting.Toolbar.STUB_EXTENDED_CLASS_ = 'toolbar-stub-extended'; 171 remoting.Toolbar.STUB_EXTENDED_CLASS_ = 'toolbar-stub-extended';
171 /** @private */ 172 /** @private */
172 remoting.Toolbar.VISIBLE_CLASS_ = 'toolbar-visible'; 173 remoting.Toolbar.VISIBLE_CLASS_ = 'toolbar-visible';
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698