| 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 <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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 286 |
| 287 void UiScene::UpdateBackgroundFromDict(const base::DictionaryValue& dict) { | 287 void UiScene::UpdateBackgroundFromDict(const base::DictionaryValue& dict) { |
| 288 ParseColorf(dict, "color", &background_color_); | 288 ParseColorf(dict, "color", &background_color_); |
| 289 ParseFloat(dict, "distance", &background_distance_); | 289 ParseFloat(dict, "distance", &background_distance_); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void UiScene::HandleCommands(std::unique_ptr<base::ListValue> commands, | 292 void UiScene::HandleCommands(std::unique_ptr<base::ListValue> commands, |
| 293 int64_t time_in_micro) { | 293 int64_t time_in_micro) { |
| 294 for (auto& item : *commands) { | 294 for (auto& item : *commands) { |
| 295 base::DictionaryValue* dict; | 295 base::DictionaryValue* dict; |
| 296 CHECK(item->GetAsDictionary(&dict)); | 296 CHECK(item.GetAsDictionary(&dict)); |
| 297 | 297 |
| 298 Command type; | 298 Command type; |
| 299 base::DictionaryValue* data; | 299 base::DictionaryValue* data; |
| 300 CHECK(ParseInt(*dict, "type", &type)); | 300 CHECK(ParseInt(*dict, "type", &type)); |
| 301 CHECK(dict->GetDictionary("data", &data)); | 301 CHECK(dict->GetDictionary("data", &data)); |
| 302 | 302 |
| 303 switch (type) { | 303 switch (type) { |
| 304 case Command::ADD_ELEMENT: | 304 case Command::ADD_ELEMENT: |
| 305 AddUiElementFromDict(*data); | 305 AddUiElementFromDict(*data); |
| 306 break; | 306 break; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 content_element_ = element; | 457 content_element_ = element; |
| 458 break; | 458 break; |
| 459 default: | 459 default: |
| 460 element->fill = Fill::NONE; | 460 element->fill = Fill::NONE; |
| 461 break; | 461 break; |
| 462 } | 462 } |
| 463 } | 463 } |
| 464 } | 464 } |
| 465 | 465 |
| 466 } // namespace vr_shell | 466 } // namespace vr_shell |
| OLD | NEW |