0

[xr] Added wait state and extra buttons to permission page

Added a wait state (hour glass) to the UI so that when the user
clicks on a permission button but the callbacks are yet to fire
because of delay in the system, users do not perceive it as an
issue with the XR stack.

Also, added buttons for MIDI and screen-share.

midi-button.png is created by snapshotting src/components/vector_icons/midi.icon icon loaded into views_examples_exe. GIMP is used to edit/export

screen-share-button.png is sourced from src/chrome/android/java/res/drawable-xxxhdpi/infobar_screen_share.png, resized and colored black

hourglass-button.png is essentially resized and colorized version of src/third_party/material_design_icons/src/action/ios/ic_hourglass_empty.imageset/ic_hourglass_empty_3x.png

Bug: 952040, 951425
Change-Id: Ia51c0324d1c3864c1930868a9a66d4324fc1bc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1569968
Commit-Queue: Suman Kancherla <sumankancherla@chromium.org>
Reviewed-by: Klaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652233}
This commit is contained in:
Suman Kancherla
2019-04-18 18:39:24 +00:00
committed by Commit Bot
parent c70e766cde
commit fd3e2d400b
4 changed files with 16 additions and 0 deletions
third_party/webxr_test_pages/webxr-samples

Binary file not shown.

After

(image error) Size: 205 B

Binary file not shown.

After

(image error) Size: 303 B

Binary file not shown.

After

(image error) Size: 178 B

@ -86,6 +86,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
let checkTexture = new UrlTexture('../../media/textures/check-button.png');
let xTexture = new UrlTexture('../../media/textures/x-button.png');
let waitTexture = new UrlTexture('../test-media/third-party/hourglass-button.png');
function initXR() {
xrButton = new XRDeviceButton({
@ -123,6 +124,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
function addPermissionButton(iconUrl, callback, yAngle, yOffset) {
let button = new ButtonNode(new UrlTexture(iconUrl), () => {
button.iconTexture = waitTexture;
callback(
() => { button.iconTexture = checkTexture; }, // Success callback
() => { button.iconTexture = xTexture; } // Failure callback
@ -190,6 +192,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.then(success, fail);
}
},
{
icon: '../test-media/third-party/midi-button.png',
callback: (success, fail) => {
navigator.requestMIDIAccess({ sysex: true })
.then(success, fail);
}
},
{
icon: '../test-media/third-party/screen-share-button.png',
callback: (success, fail) => {
navigator.mediaDevices.getDisplayMedia()
.then(success, fail);
}
},
]);
}