Chromium Code Reviews| 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..2a9f3c7847297121db553f0fd5e43c2fbccea049 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,17 @@ UiElement* UiScene::GetUiElementById(int element_id) { |
| return nullptr; |
| } |
| +UiElement* UiScene::GetUiElementByIdentifier( |
|
Ian Vollick
2017/05/19 14:42:32
nit/bikeshed: Id and Identifier are pretty close.
cjgrant
2017/05/19 15:10:40
Sure. I'll adapt that when we close on the NDEBUG
|
| + UiElementIdentifier identifier) const { |
| + DCHECK(identifier != UiElementIdentifier::kNone); |
| + for (const auto& element : ui_elements_) { |
| + if (element->identifier() == identifier) { |
| + return element.get(); |
| + } |
| + } |
| + return nullptr; |
| +} |
| + |
| std::vector<const UiElement*> UiScene::GetWorldElements() const { |
| std::vector<const UiElement*> elements; |
| for (const auto& element : ui_elements_) { |