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

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

Issue 2442873002: Control the VrShell content quad via the HTML UI. (Closed)
Patch Set: 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..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);
« 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