summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-19 23:09:48 +0000
committerjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-19 23:09:48 +0000
commitfb5f11e250cd515c93e64e813c45dbd208e301f8 (patch)
tree928c01290ad0e52e49dfd7623f8c0d782cbea637 /remoting
parenta2f4889699808b689841f279a055100e7e4580f6 (diff)
downloadchromium_src-fb5f11e250cd515c93e64e813c45dbd208e301f8.zip
chromium_src-fb5f11e250cd515c93e64e813c45dbd208e301f8.tar.gz
chromium_src-fb5f11e250cd515c93e64e813c45dbd208e301f8.tar.bz2
Fixed web-app share error handling.
BUG=None TEST=Wait for our bigtable cell to fail and try to share. Alternatively, just unplug the network cable (although this is a different failure mode). Review URL: http://codereview.chromium.org/7697005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97530 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/plugin/host_script_object.cc3
-rw-r--r--remoting/webapp/me2mom/remoting.js9
2 files changed, 10 insertions, 2 deletions
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
index 3553e2e..72449d9 100644
--- a/remoting/host/plugin/host_script_object.cc
+++ b/remoting/host/plugin/host_script_object.cc
@@ -459,7 +459,7 @@ void HostNPScriptObject::FinishConnect(
base::Bind(&HostNPScriptObject::OnReceivedSupportID,
base::Unretained(this),
access_verifier.get()))) {
- OnStateChanged(kDisconnected);
+ OnStateChanged(kError);
return;
}
@@ -567,6 +567,7 @@ void HostNPScriptObject::OnReceivedSupportID(
if (!success) {
// TODO(wez): Replace the success/fail flag with full error reporting.
+ OnStateChanged(kError);
DisconnectInternal();
return;
}
diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js
index 52c363d..c0a0a3c 100644
--- a/remoting/webapp/me2mom/remoting.js
+++ b/remoting/webapp/me2mom/remoting.js
@@ -320,8 +320,15 @@ function onStateChanged_() {
remoting.setMode(remoting.AppMode.HOST_SHARED);
disableTimeoutCountdown_();
} else if (state == plugin.DISCONNECTED) {
- remoting.setMode(remoting.AppMode.HOST_UNSHARED);
+ if (remoting.currentMode != remoting.AppMode.HOST_SHARE_FAILED) {
+ // If an error is being displayed, then the plugin should not be able to
+ // hide it by setting the state. Errors must be dismissed by the user
+ // clicking OK, which puts the app into mode HOST_UNSHARED.
+ remoting.setMode(remoting.AppMode.HOST_UNSHARED);
+ }
plugin.parentNode.removeChild(plugin);
+ } else if (state == plugin.ERROR) {
+ remoting.setMode(remoting.AppMode.HOST_SHARE_FAILED);
} else {
remoting.debug.log('Unknown state -> ' + state);
}