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..3a27bbe3e9f50a612381e2f5364aeb94a60df497 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_quad_ = nullptr; |
+ } |
ui_elements_.erase(it); |
return; |
} |
@@ -335,6 +338,10 @@ ContentRectangle* UiScene::GetUiElementById(int element_id) { |
return nullptr; |
} |
+ContentRectangle* UiScene::GetContentQuad() { |
+ return content_quad_; |
+} |
+ |
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_) { |
mthiesse
2016/10/24 14:23:08
typo here?
cjgrant
2016/10/24 14:28:21
Are you saying you don't think this would compile?
cjgrant
2016/10/26 01:10:00
Done.
|
+ CHECK_EQ(content_quad_, nullptr); |
+ content_quad_ = element; |
bshe
2016/10/24 18:09:38
nit: rename to content_element_ since it caches an
cjgrant
2016/10/26 01:10:00
Done.
|
+ } else { |
+ if (content_quad_ == element) { |
+ content_quad_ = nullptr; |
+ } |
+ } |
+ } |
+ |
if (dict.GetInteger("xAnchoring", |
reinterpret_cast<int*>(&element->x_anchoring))) { |
CHECK_GE(element->parent_id, 0); |