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 |