Index: chrome/browser/android/vr_shell/ui_scene.cc |
diff --git a/chrome/browser/android/vr_shell/ui_scene.cc b/chrome/browser/android/vr_shell/ui_scene.cc |
index 52e3684fc81ae548040b4ae998be3f0afca9bc13..d470fed1b14635bb9cc8a57b6154150102d583fe 100644 |
--- a/chrome/browser/android/vr_shell/ui_scene.cc |
+++ b/chrome/browser/android/vr_shell/ui_scene.cc |
@@ -121,7 +121,7 @@ void UiScene::OnBeginFrame(const base::TimeTicks& current_time) { |
} |
} |
-UiElement* UiScene::GetUiElementById(int element_id) { |
+UiElement* UiScene::GetUiElementById(int element_id) const { |
for (const auto& element : ui_elements_) { |
if (element->id() == element_id) { |
return element.get(); |
@@ -130,6 +130,16 @@ UiElement* UiScene::GetUiElementById(int element_id) { |
return nullptr; |
} |
+UiElement* UiScene::GetUiElementByDebugId(UiElementDebugId debug_id) const { |
+ DCHECK(debug_id != UiElementDebugId::kNone); |
+ for (const auto& element : ui_elements_) { |
+ if (element->debug_id() == debug_id) { |
+ return element.get(); |
+ } |
+ } |
+ return nullptr; |
+} |
+ |
std::vector<const UiElement*> UiScene::GetWorldElements() const { |
std::vector<const UiElement*> elements; |
for (const auto& element : ui_elements_) { |