Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4315)

Unified Diff: chrome/browser/resources/vr_shell/vr_shell_ui_api.js

Issue 2749703007: Add menu mode plumbing for WebVR mode. (Closed)
Patch Set: Rename JS WebVR rendering functions for clarity. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/vr_shell/vr_shell_ui_api.js
diff --git a/chrome/browser/resources/vr_shell/vr_shell_ui_api.js b/chrome/browser/resources/vr_shell/vr_shell_ui_api.js
index 27ee406ba2544305405ab746574c3ea82b7ba65d..05204e93e0e6297336c9b9e666d84c7e1d35c780 100644
--- a/chrome/browser/resources/vr_shell/vr_shell_ui_api.js
+++ b/chrome/browser/resources/vr_shell/vr_shell_ui_api.js
@@ -15,7 +15,7 @@ api.Command = {
'REMOVE_ELEMENT': 2,
'ADD_ANIMATION': 3,
'REMOVE_ANIMATION': 4,
- 'UPDATE_BACKGROUND': 5
+ 'CONFIGURE_SCENE': 5
};
/**
@@ -560,6 +560,49 @@ api.Animation = class {
};
/**
+ * Scene configuration class. Use this object to generate the payload of a
+ * CONFIGURE_SCENE command.
+ * @struct
+ */
+api.SceneConfiguration = class {
+ constructor() {
+ /** @private {!Object} */
+ this.properties = {};
+ }
+
+ getCommandPayload() {
+ return this.properties;
+ }
+
+ /**
+ * Set the background color of the scene.
+ * @param {{r: number, b: number, g: number, a: number}} color
+ */
+ setBackgroundColor(color) {
+ this.properties.backgroundColor = color;
+ }
+
+ /**
+ * Set the radius of the background-bounding sphere.
+ * @param {number} distance
+ */
+ setBackgroundDistance(distance) {
+ this.properties.backgroundDistance = distance;
+ }
+
+ /**
+ * Enable or disable rendering of WebVR content in the foreground. Rendering
+ * defaults to enabled when on a WebVR page. This property allows rendering to
+ * be disabled, for purposes of showing an alternate UI (such as a menu). When
+ * disabled, the cursor is rendered.
+ * @param {boolean} enabled
+ */
+ setWebVrRenderingModeEnabled(enabled) {
+ this.properties.drawWebVr = enabled;
+ }
+};
+
+/**
* Abstract class handling webui command calls from native. The UI must
* subclass this and override the handlers.
* @abstract
« no previous file with comments | « chrome/browser/resources/vr_shell/vr_shell_ui.js ('k') | chrome/browser/resources/vr_shell/vr_shell_ui_scene.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698