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

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

Issue 2698623007: Change how the VR reticle distance is determined. (Closed)
Patch Set: Change background distance multplier to 1.414; move Reload UI button out of the floor. Created 3 years, 10 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 8824338a7afc01f86955fe5e69e7c1dc7ee2b56a..a85fd877b54dc567a315c4226b8db79f0b301766 100644
--- a/chrome/browser/android/vr_shell/ui_scene.cc
+++ b/chrome/browser/android/vr_shell/ui_scene.cc
@@ -16,6 +16,17 @@ namespace vr_shell {
namespace {
+bool ParseFloat(const base::DictionaryValue& dict,
+ const std::string& key,
+ float* output) {
+ double value;
+ if (!dict.GetDouble(key, &value)) {
+ return false;
+ }
+ *output = value;
+ return true;
+}
+
bool ParseRecti(const base::DictionaryValue& dict,
const std::string& key,
Recti* output) {
@@ -323,6 +334,7 @@ void UiScene::RemoveAnimation(int element_id, int animation_id) {
void UiScene::UpdateBackgroundFromDict(const base::DictionaryValue& dict) {
ParseColorf(dict, "color", &background_color_);
+ ParseFloat(dict, "distance", &background_distance_);
}
void UiScene::HandleCommands(std::unique_ptr<base::ListValue> commands,
@@ -390,14 +402,14 @@ ContentRectangle* UiScene::GetUiElementById(int element_id) {
return nullptr;
}
-ContentRectangle* UiScene::GetContentQuad() {
- return content_element_;
-}
-
const Colorf& UiScene::GetBackgroundColor() {
return background_color_;
}
+float UiScene::GetBackgroundDistance() {
+ return background_distance_;
+}
+
const std::vector<std::unique_ptr<ContentRectangle>>&
UiScene::GetUiElements() const {
return ui_elements_;
« 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