OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/android/vr_shell/ui_scene.h" | 5 #include "chrome/browser/android/vr_shell/ui_scene.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/android/vr_shell/animation.h" | 8 #include "chrome/browser/android/vr_shell/animation.h" |
9 #include "chrome/browser/android/vr_shell/easing.h" | 9 #include "chrome/browser/android/vr_shell/easing.h" |
10 #include "chrome/browser/android/vr_shell/ui_elements.h" | 10 #include "chrome/browser/android/vr_shell/ui_elements.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 void UiScene::ApplyDictToElement(const base::DictionaryValue& dict, | 369 void UiScene::ApplyDictToElement(const base::DictionaryValue& dict, |
370 ContentRectangle *element) { | 370 ContentRectangle *element) { |
371 int parent_id; | 371 int parent_id; |
372 if (dict.GetInteger("parentId", &parent_id)) { | 372 if (dict.GetInteger("parentId", &parent_id)) { |
373 CHECK_GE(parent_id, 0); | 373 CHECK_GE(parent_id, 0); |
374 CHECK_NE(GetUiElementById(parent_id), nullptr); | 374 CHECK_NE(GetUiElementById(parent_id), nullptr); |
375 element->parent_id = parent_id; | 375 element->parent_id = parent_id; |
376 } | 376 } |
377 | 377 |
378 dict.GetBoolean("visible", &element->visible); | 378 dict.GetBoolean("visible", &element->visible); |
| 379 dict.GetBoolean("hitTestable", &element->hit_testable); |
| 380 dict.GetBoolean("lockToFov", &element->lock_to_fov); |
379 ParseRecti(dict, "copyRect", &element->copy_rect); | 381 ParseRecti(dict, "copyRect", &element->copy_rect); |
380 Parse2DVec3f(dict, "size", &element->size); | 382 Parse2DVec3f(dict, "size", &element->size); |
381 ParseVec3f(dict, "scale", &element->scale); | 383 ParseVec3f(dict, "scale", &element->scale); |
382 ParseRotationAxisAngle(dict, "rotation", &element->rotation); | 384 ParseRotationAxisAngle(dict, "rotation", &element->rotation); |
383 ParseVec3f(dict, "translation", &element->translation); | 385 ParseVec3f(dict, "translation", &element->translation); |
384 | 386 |
385 if (dict.GetInteger("xAnchoring", | 387 if (dict.GetInteger("xAnchoring", |
386 reinterpret_cast<int*>(&element->x_anchoring))) { | 388 reinterpret_cast<int*>(&element->x_anchoring))) { |
387 CHECK_GE(element->parent_id, 0); | 389 CHECK_GE(element->parent_id, 0); |
388 } | 390 } |
389 if (dict.GetInteger("yAnchoring", | 391 if (dict.GetInteger("yAnchoring", |
390 reinterpret_cast<int*>(&element->y_anchoring))) { | 392 reinterpret_cast<int*>(&element->y_anchoring))) { |
391 CHECK_GE(element->parent_id, 0); | 393 CHECK_GE(element->parent_id, 0); |
392 } | 394 } |
393 } | 395 } |
394 | 396 |
395 } // namespace vr_shell | 397 } // namespace vr_shell |
OLD | NEW |