diff options
author | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-27 20:06:03 +0000 |
---|---|---|
committer | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-27 20:06:03 +0000 |
commit | df385dd4b61d912981a0b2db3d786dcf95fc6206 (patch) | |
tree | c141e5b9cc6f5ec147079271dfa092b98ebd488f /remoting/webapp | |
parent | 488488caed289935b86679542ef7c3399a4040f0 (diff) | |
download | chromium_src-df385dd4b61d912981a0b2db3d786dcf95fc6206.zip chromium_src-df385dd4b61d912981a0b2db3d786dcf95fc6206.tar.gz chromium_src-df385dd4b61d912981a0b2db3d786dcf95fc6206.tar.bz2 |
Fixup error message shown when Chromoting is not enabled properly.
Previously, we did a version check first, so if the plugin didn't load we
would display an (inappropriate) "version mis-match, please upgrade" message.
This was very frustrating since it often happened immediately after
installation, when the user was trying to use Remoting for the first time.
This change checks the plugin status first and (if there's a problem) directs
the user to verify that the 'Remoting' and 'P2P API' flags are enabled.
This partially addresses bug 87282, but we still need to make this look
prettier.
BUG=87282
TEST=manual
Review URL: http://codereview.chromium.org/7263008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90626 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp')
-rw-r--r-- | remoting/webapp/me2mom/remoting_session.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/remoting/webapp/me2mom/remoting_session.js b/remoting/webapp/me2mom/remoting_session.js index 055fc7e..556d869 100644 --- a/remoting/webapp/me2mom/remoting_session.js +++ b/remoting/webapp/me2mom/remoting_session.js @@ -134,6 +134,12 @@ function init_() { plugin.desktopSizeUpdate = desktopSizeChanged; plugin.loginChallenge = loginChallengeCallback; + if (typeof plugin.connect !== 'function') { + setClientStateMessage("Unable to load plugin. Please make sure that " + + "'Remoting' and 'P2P API' are enabled in chrome://flags."); + return; + } + if (!checkVersion(plugin)) { // TODO(garykac): We need better messaging here. Perhaps an install link. setClientStateMessage("Out of date. Please re-install."); @@ -141,15 +147,7 @@ function init_() { } addToDebugLog('Connect as user ' + remoting.username); - - // TODO(garykac): Clean exit if |connect| isn't a function. - if (typeof plugin.connect === 'function') { - registerConnection(); - } else { - addToDebugLog('ERROR: remoting plugin not loaded'); - setClientStateMessage('Plugin not loaded'); - } - + registerConnection(); } function toggleScaleToFit() { |