diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-28 17:44:04 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-28 17:44:04 +0000 |
commit | a9b62a20a765d2c36c4f76a72394c8940fe96636 (patch) | |
tree | dd948a2959654fffa804aa72c32626c98189e7c1 /remoting/webapp/error.js | |
parent | aa8101382f9e46bbfefb89cac05b91c715e7175b (diff) | |
download | chromium_src-a9b62a20a765d2c36c4f76a72394c8940fe96636.zip chromium_src-a9b62a20a765d2c36c4f76a72394c8940fe96636.tar.gz chromium_src-a9b62a20a765d2c36c4f76a72394c8940fe96636.tar.bz2 |
Change HostController methods to accept onError callbacks.
The HostController methods which took a |callback| parameter now
accept an additional |onError| callback. Previously, an AsyncResult was
passed to |callback| to indicate success/failure. Instead, |callback|
takes no parameters, and |onError| is called on failure, passing in a
remoting.Error code. New error-codes have been added to correspond to
AsyncResult.CANCELED and AsyncResult.FAILED_DIRECTORY.
HostSetupDialog has been modified to use the new interface, and no
longer uses HostController.AsyncResult. In particular,
HostSetupFlow.switchToNextStep(AsyncResult result) has been split into
two methods for the success and failure cases.
BUG=249970
TEST=Verify host setup flow under normal and error conditions.
R=jamiewalch@chromium.org, sergeyu@chromium.org
Review URL: https://codereview.chromium.org/17764004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp/error.js')
-rw-r--r-- | remoting/webapp/error.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/remoting/webapp/error.js b/remoting/webapp/error.js index a1e3ab3..756e3e6 100644 --- a/remoting/webapp/error.js +++ b/remoting/webapp/error.js @@ -11,6 +11,11 @@ var remoting = remoting || {}; * @enum {string} All error messages from messages.json */ remoting.Error = { + // Used to signify that an operation was cancelled by the user. This should + // not normally cause the error text to be shown to the user, so the + // i18n-content prefix is not needed in this case. + CANCELLED: '__CANCELLED__', + INVALID_ACCESS_CODE: /*i18n-content*/'ERROR_INVALID_ACCESS_CODE', MISSING_PLUGIN: /*i18n-content*/'ERROR_MISSING_PLUGIN', AUTHENTICATION_FAILED: /*i18n-content*/'ERROR_AUTHENTICATION_FAILED', @@ -23,5 +28,6 @@ remoting.Error = { SERVICE_UNAVAILABLE: /*i18n-content*/'ERROR_SERVICE_UNAVAILABLE', NOT_AUTHENTICATED: /*i18n-content*/'ERROR_NOT_AUTHENTICATED', INVALID_HOST_DOMAIN: /*i18n-content*/'ERROR_INVALID_HOST_DOMAIN', - P2P_FAILURE: /*i18n-content*/'ERROR_P2P_FAILURE' + P2P_FAILURE: /*i18n-content*/'ERROR_P2P_FAILURE', + REGISTRATION_FAILED: /*i18n-content*/'ERROR_HOST_REGISTRATION_FAILED' }; |