0

CRD Webapp changes to support Confirmation Dialog It2Me state

This change adds a new state to the CRD webapp.  This state
is sent to the Webapp/client to indicate that the remote user has
started the connection process but has not yet completed it.  For our
purposes, this state will signal that the local user must take action
(i.e. click Share on the confirmation dialog) and we can use it to
updated the text / UI state on the local machine.

The strings and webapp dialog are also updated to inform the user that
an action is required on their part to complete the process.

BUG=658459

Review-Url: https://codereview.chromium.org/2453193004
Cr-Commit-Position: refs/heads/master@{#428790}
This commit is contained in:
joedow
2016-10-31 13:29:51 -07:00
committed by Commit bot
parent f9ab0e9b3c
commit 46c2064c3f
5 changed files with 22 additions and 7 deletions

@@ -870,7 +870,10 @@ For information about privacy, please see the Google Privacy Policy (http://goo.
To begin sharing your desktop, give the access code below to the person who will be assisting you.
</message>
<message desc="Instructions shown below the access code when it is ready to be conveyed to the client." name="IDS_INSTRUCTIONS_SHARE_BELOW">
Once they enter the code your sharing session will begin.
Once they enter the code, you will be prompted to accept the connection and begin the sharing session.
</message>
<message desc="Instructions shown when the local user must accept or reject the incoming connection request." name="IDS_INSTRUCTIONS_SHARE_PROMPT">
Please select '<ph name="SHARE">$1<ex>Share</ex></ph>' on the connection dialog box to complete the process.
</message>
<message desc="An error message displayed if the user enters an invalid PIN while setting up a host." name="IDS_INVALID_PIN">
Please enter a PIN consisting of six or more digits.

@@ -29,6 +29,7 @@ remoting.AppMode = {
HOST: 'home.host',
HOST_WAITING_FOR_CODE: 'home.host.waiting-for-code',
HOST_WAITING_FOR_CONNECTION: 'home.host.waiting-for-connection',
HOST_WAITING_FOR_ACCEPT: 'home.host.waiting-for-accept',
HOST_SHARED: 'home.host.shared',
HOST_SHARE_FAILED: 'home.host.share-failed',
HOST_SHARE_FINISHED: 'home.host.share-finished',

@@ -64,4 +64,9 @@ found in the LICENSE file.
<button id="cancel-share-button" i18n-content="CANCEL"></button>
</div>
<div data-ui-mode="home.host.waiting-for-accept">
<span i18n-content="INSTRUCTIONS_SHARE_PROMPT"
i18n-value-name-1="SHARE_CONFIRM_DIALOG_CONFIRM" ></span>
</div>
</div> <!-- host dialog -->

@@ -170,6 +170,11 @@ function onHostStateChanged_(state) {
remoting.cancelShare();
}
} else if (state == remoting.HostSession.State.CONNECTING) {
console.log('Host state: CONNECTING');
remoting.setMode(remoting.AppMode.HOST_WAITING_FOR_ACCEPT);
disableTimeoutCountdown_();
} else if (state == remoting.HostSession.State.CONNECTED) {
console.log('Host state: CONNECTED');
var element = document.getElementById('host-shared-message');

@@ -25,8 +25,8 @@ remoting.HostSession = function() {
this.hostFacade_ = null;
};
// Note that these values are copied directly from host_script_object.h and
// must be kept in sync.
// Note that these values are copied directly from it2me_host.h and must be kept
// in sync.
/** @enum {number} */
remoting.HostSession.State = {
UNKNOWN: -1,
@@ -34,10 +34,11 @@ remoting.HostSession.State = {
STARTING: 1,
REQUESTED_ACCESS_CODE: 2,
RECEIVED_ACCESS_CODE: 3,
CONNECTED: 4,
DISCONNECTING: 5,
ERROR: 6,
INVALID_DOMAIN_ERROR: 7
CONNECTING: 4,
CONNECTED: 5,
DISCONNECTING: 6,
ERROR: 7,
INVALID_DOMAIN_ERROR: 8,
};
remoting.HostSession.prototype.dispose = function() {