Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: chrome/browser/android/vr_shell/ui_scene.cc

Issue 2442873002: Control the VrShell content quad via the HTML UI. (Closed)
Patch Set: Rebase; address nits and bug. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene.h ('k') | chrome/browser/android/vr_shell/ui_scene_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene.h ('k') | chrome/browser/android/vr_shell/ui_scene_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698