Index: chrome/browser/resources/vr_shell/vr_shell_ui.js |
diff --git a/chrome/browser/resources/vr_shell/vr_shell_ui.js b/chrome/browser/resources/vr_shell/vr_shell_ui.js |
index 7203c2c9dbe58c76c98e1f4aa737e4ffca505a28..e77fc942ca2b8af11ae5c9382ad082cf36446c2e 100644 |
--- a/chrome/browser/resources/vr_shell/vr_shell_ui.js |
+++ b/chrome/browser/resources/vr_shell/vr_shell_ui.js |
@@ -16,6 +16,8 @@ var vrShellUi = (function() { |
// This value should match the one in VrShellImpl.java |
/** @const */ var UI_DPR = 1.2; |
+ var domIdToUiElementIdMap = {}; |
+ |
function getStyleFloat(style, property, defaultValue) { |
let value = parseFloat(style.getPropertyValue(property)); |
return isNaN(value) ? defaultValue : value; |
@@ -36,6 +38,10 @@ var vrShellUi = (function() { |
'%, ' + background + ' 100%)'; |
} |
+ function getUiElementId(domId) { |
+ return domId in domIdToUiElementIdMap ? domIdToUiElementIdMap[domId] : -1; |
+ } |
+ |
class ContentQuad { |
constructor() { |
/** @const */ this.SCREEN_HEIGHT = 1.375; |
@@ -206,6 +212,7 @@ var vrShellUi = (function() { |
this.id = ui.addElement(element); |
this.domElement = domElement; |
+ domIdToUiElementIdMap[domId] = this.id; |
tiborg
2017/03/27 15:14:33
cjgrant@: is this a good workaround until the name
cjgrant
2017/03/27 15:41:32
Brian said he'd wait on using element names, as th
bsheedy
2017/03/27 17:49:09
Do we really need a map since we're removing all t
cjgrant
2017/03/27 19:49:43
That works if test will only ever check native sta
tiborg
2017/03/27 19:59:59
+1 to add the map once we need it.
|
} |
}; |
@@ -1339,6 +1346,7 @@ var vrShellUi = (function() { |
return { |
initialize: initialize, |
command: command, |
+ getUiElementId: getUiElementId, |
}; |
})(); |