| 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 cc785d20c36b466bf8b5d56b38ecdcc00b1b72c1..be4d83b15f0660cc95ea659bc5a7ab779beae070 100644
|
| --- a/chrome/browser/android/vr_shell/ui_scene.cc
|
| +++ b/chrome/browser/android/vr_shell/ui_scene.cc
|
| @@ -202,6 +202,9 @@ void UiScene::UpdateUiElementFromDict(const base::DictionaryValue& dict) {
|
| void UiScene::RemoveUiElement(int element_id) {
|
| for (auto it = ui_elements_.begin(); it != ui_elements_.end(); ++it) {
|
| if ((*it)->id == element_id) {
|
| + if ((*it)->content_quad) {
|
| + content_element_ = nullptr;
|
| + }
|
| ui_elements_.erase(it);
|
| return;
|
| }
|
| @@ -335,6 +338,10 @@ ContentRectangle* UiScene::GetUiElementById(int element_id) {
|
| return nullptr;
|
| }
|
|
|
| +ContentRectangle* UiScene::GetContentQuad() {
|
| + return content_element_;
|
| +}
|
| +
|
| const std::vector<std::unique_ptr<ContentRectangle>>&
|
| UiScene::GetUiElements() const {
|
| return ui_elements_;
|
| @@ -384,6 +391,17 @@ void UiScene::ApplyDictToElement(const base::DictionaryValue& dict,
|
| ParseRotationAxisAngle(dict, "rotation", &element->rotation);
|
| ParseVec3f(dict, "translation", &element->translation);
|
|
|
| + if (dict.GetBoolean("contentQuad", &element->content_quad)) {
|
| + if (element->content_quad) {
|
| + CHECK_EQ(content_element_, nullptr);
|
| + content_element_ = element;
|
| + } else {
|
| + if (content_element_ == element) {
|
| + content_element_ = nullptr;
|
| + }
|
| + }
|
| + }
|
| +
|
| if (dict.GetInteger("xAnchoring",
|
| reinterpret_cast<int*>(&element->x_anchoring))) {
|
| CHECK_GE(element->parent_id, 0);
|
|
|