| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 CHECK(item_dict->GetDouble("a", &value)); | 65 CHECK(item_dict->GetDouble("a", &value)); |
| 66 output->angle = value; | 66 output->angle = value; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 void ParseFloats(const base::DictionaryValue& dict, | 70 void ParseFloats(const base::DictionaryValue& dict, |
| 71 const std::vector<std::string>& keys, | 71 const std::vector<std::string>& keys, |
| 72 std::vector<float>* vec) { | 72 std::vector<float>* vec) { |
| 73 for (const auto& key : keys) { | 73 for (const auto& key : keys) { |
| 74 double value; | 74 double value; |
| 75 CHECK(dict.GetDouble(key, &value)) << "parsing tag " << key; | 75 // parsing tag |key|. |
| 76 CHECK(dict.GetDouble(key, &value)); |
| 76 vec->push_back(value); | 77 vec->push_back(value); |
| 77 } | 78 } |
| 78 } | 79 } |
| 79 | 80 |
| 80 void ParseEndpointToFloats(Animation::Property property, | 81 void ParseEndpointToFloats(Animation::Property property, |
| 81 const base::DictionaryValue& dict, | 82 const base::DictionaryValue& dict, |
| 82 std::vector<float>* vec) { | 83 std::vector<float>* vec) { |
| 83 switch (property) { | 84 switch (property) { |
| 84 case Animation::Property::COPYRECT: | 85 case Animation::Property::COPYRECT: |
| 85 ParseFloats(dict, {"x", "y", "width", "height"}, vec); | 86 ParseFloats(dict, {"x", "y", "width", "height"}, vec); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 reinterpret_cast<int*>(&element->x_anchoring))) { | 407 reinterpret_cast<int*>(&element->x_anchoring))) { |
| 407 CHECK_GE(element->parent_id, 0); | 408 CHECK_GE(element->parent_id, 0); |
| 408 } | 409 } |
| 409 if (dict.GetInteger("yAnchoring", | 410 if (dict.GetInteger("yAnchoring", |
| 410 reinterpret_cast<int*>(&element->y_anchoring))) { | 411 reinterpret_cast<int*>(&element->y_anchoring))) { |
| 411 CHECK_GE(element->parent_id, 0); | 412 CHECK_GE(element->parent_id, 0); |
| 412 } | 413 } |
| 413 } | 414 } |
| 414 | 415 |
| 415 } // namespace vr_shell | 416 } // namespace vr_shell |
| OLD | NEW |