OLD | NEW |
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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
9 | 9 |
10 /** | 10 /** |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 /** | 173 /** |
174 * Show an error message, optionally including a short-cut for signing in to | 174 * Show an error message, optionally including a short-cut for signing in to |
175 * Chromoting again. | 175 * Chromoting again. |
176 * | 176 * |
177 * @param {!remoting.Error} error | 177 * @param {!remoting.Error} error |
178 * @return {void} Nothing. | 178 * @return {void} Nothing. |
179 */ | 179 */ |
180 remoting.showErrorMessage = function(error) { | 180 remoting.showErrorMessage = function(error) { |
181 l10n.localizeElementFromTag( | 181 l10n.localizeElementFromTag( |
182 document.getElementById('token-refresh-error-message'), | 182 document.getElementById('token-refresh-error-message'), |
183 error.tag); | 183 error.getTag()); |
184 var auth_failed = (error.tag == remoting.Error.Tag.AUTHENTICATION_FAILED); | 184 var auth_failed = (error.hasTag(remoting.Error.Tag.AUTHENTICATION_FAILED)); |
185 if (auth_failed && base.isAppsV2()) { | 185 if (auth_failed && base.isAppsV2()) { |
186 remoting.handleAuthFailureAndRelaunch(); | 186 remoting.handleAuthFailureAndRelaunch(); |
187 } else { | 187 } else { |
188 document.getElementById('token-refresh-auth-failed').hidden = !auth_failed; | 188 document.getElementById('token-refresh-auth-failed').hidden = !auth_failed; |
189 document.getElementById('token-refresh-other-error').hidden = auth_failed; | 189 document.getElementById('token-refresh-other-error').hidden = auth_failed; |
190 remoting.setMode(remoting.AppMode.TOKEN_REFRESH_FAILED); | 190 remoting.setMode(remoting.AppMode.TOKEN_REFRESH_FAILED); |
191 } | 191 } |
192 }; | 192 }; |
193 | 193 |
194 /** | 194 /** |
(...skipping 13 matching lines...) Expand all Loading... |
208 } else { | 208 } else { |
209 chrome.windows.get(tab.windowId, null, windowCallback); | 209 chrome.windows.get(tab.windowId, null, windowCallback); |
210 } | 210 } |
211 }; | 211 }; |
212 if (chrome.tabs) { | 212 if (chrome.tabs) { |
213 chrome.tabs.getCurrent(tabCallback); | 213 chrome.tabs.getCurrent(tabCallback); |
214 } else { | 214 } else { |
215 console.error('chome.tabs is not available.'); | 215 console.error('chome.tabs is not available.'); |
216 } | 216 } |
217 } | 217 } |
OLD | NEW |