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

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

Issue 988963003: Add Application.Delegate.stop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer feedback. Created 5 years, 9 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
« no previous file with comments | « no previous file | remoting/webapp/base/js/application.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * This class implements the functionality that is specific to application 7 * This class implements the functionality that is specific to application
8 * remoting ("AppRemoting" or AR). 8 * remoting ("AppRemoting" or AR).
9 */ 9 */
10 10
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 }); 177 });
178 }; 178 };
179 179
180 /** 180 /**
181 * Report an authentication error to the user. This is called in lieu of start() 181 * Report an authentication error to the user. This is called in lieu of start()
182 * if the user cannot be authenticated or if they decline the app permissions. 182 * if the user cannot be authenticated or if they decline the app permissions.
183 * 183 *
184 * @param {remoting.Error} error The failure reason. 184 * @param {remoting.Error} error The failure reason.
185 */ 185 */
186 remoting.AppRemoting.prototype.signInFailed = function(error) { 186 remoting.AppRemoting.prototype.signInFailed = function(error) {
187 if (error == remoting.Error.CANCELLED) { 187 this.handleError(error);
188 chrome.app.window.current().close();
189 remoting.LoadingWindow.close();
190 } else {
191 this.handleError(error);
192 }
193 }; 188 };
194 189
195 /** 190 /**
196 * @return {string} Application product name to be used in UI. 191 * @return {string} Application product name to be used in UI.
197 */ 192 */
198 remoting.AppRemoting.prototype.getApplicationName = function() { 193 remoting.AppRemoting.prototype.getApplicationName = function() {
199 var manifest = chrome.runtime.getManifest(); 194 var manifest = chrome.runtime.getManifest();
200 return manifest.name; 195 return manifest.name;
201 }; 196 };
202 197
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 * @param {remoting.Error} errorTag The error to be localized and displayed. 331 * @param {remoting.Error} errorTag The error to be localized and displayed.
337 * @return {void} Nothing. 332 * @return {void} Nothing.
338 */ 333 */
339 remoting.AppRemoting.prototype.handleError = function(errorTag) { 334 remoting.AppRemoting.prototype.handleError = function(errorTag) {
340 console.error('Connection failed: ' + errorTag); 335 console.error('Connection failed: ' + errorTag);
341 remoting.LoadingWindow.close(); 336 remoting.LoadingWindow.close();
342 remoting.MessageWindow.showErrorMessage( 337 remoting.MessageWindow.showErrorMessage(
343 chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'), 338 chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'),
344 chrome.i18n.getMessage(/** @type {string} */ (errorTag))); 339 chrome.i18n.getMessage(/** @type {string} */ (errorTag)));
345 }; 340 };
341
342 /**
343 * Close the loading window before exiting.
344 */
345 remoting.AppRemoting.prototype.handleExit = function() {
346 remoting.LoadingWindow.close();
347 };
OLDNEW
« no previous file with comments | « no previous file | remoting/webapp/base/js/application.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698