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

Side by Side Diff: chrome/browser/android/vr_shell/ui_scene.cc

Issue 2775003002: Assign names to VR UI elements for debugging and test. (Closed)
Patch Set: Restore use of UiElementUpdate when adding non-sprite UI elements. Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 void UiScene::ApplyDictToElement(const base::DictionaryValue& dict, 435 void UiScene::ApplyDictToElement(const base::DictionaryValue& dict,
436 ContentRectangle* element) { 436 ContentRectangle* element) {
437 int parent_id; 437 int parent_id;
438 438
439 if (ParseInt(dict, "parentId", &parent_id)) { 439 if (ParseInt(dict, "parentId", &parent_id)) {
440 CHECK_GE(parent_id, 0); 440 CHECK_GE(parent_id, 0);
441 CHECK_NE(GetUiElementById(parent_id), nullptr); 441 CHECK_NE(GetUiElementById(parent_id), nullptr);
442 element->parent_id = parent_id; 442 element->parent_id = parent_id;
443 } 443 }
444 444
445 dict.GetString("name", &element->name);
445 dict.GetBoolean("visible", &element->visible); 446 dict.GetBoolean("visible", &element->visible);
446 dict.GetBoolean("hitTestable", &element->hit_testable); 447 dict.GetBoolean("hitTestable", &element->hit_testable);
447 dict.GetBoolean("lockToFov", &element->lock_to_fov); 448 dict.GetBoolean("lockToFov", &element->lock_to_fov);
448 ParseInt(dict, "drawPhase", &element->draw_phase); 449 ParseInt(dict, "drawPhase", &element->draw_phase);
449 ParseFloat(dict, "opacity", &element->opacity); 450 ParseFloat(dict, "opacity", &element->opacity);
450 451
451 DCHECK(!(element->lock_to_fov && element->parent_id != -1)); 452 DCHECK(!(element->lock_to_fov && element->parent_id != -1));
452 453
453 ParseFloat(dict, "sizeX", &element->size.x); 454 ParseFloat(dict, "sizeX", &element->size.x);
454 ParseFloat(dict, "sizeY", &element->size.y); 455 ParseFloat(dict, "sizeY", &element->size.y);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 content_element_ = element; 501 content_element_ = element;
501 break; 502 break;
502 default: 503 default:
503 element->fill = Fill::NONE; 504 element->fill = Fill::NONE;
504 break; 505 break;
505 } 506 }
506 } 507 }
507 } 508 }
508 509
509 } // namespace vr_shell 510 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_elements.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