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

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

Issue 2749703007: Add menu mode plumbing for WebVR mode. (Closed)
Patch Set: Address comments. Created 3 years, 9 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
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 2b6ac528c82a547114659117f69dbd429b973765..382a31a4486372b8c7e638b86f0eb0ae7f7f78c5 100644
--- a/chrome/browser/android/vr_shell/ui_scene.cc
+++ b/chrome/browser/android/vr_shell/ui_scene.cc
@@ -284,11 +284,6 @@ 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,
int64_t time_in_micro) {
for (auto& item : *commands) {
@@ -323,8 +318,10 @@ void UiScene::HandleCommands(std::unique_ptr<base::ListValue> commands,
RemoveAnimation(element_id, animation_id);
break;
}
- case Command::UPDATE_BACKGROUND:
- UpdateBackgroundFromDict(*data);
+ case Command::CONFIGURE_SCENE:
+ ParseColorf(*data, "backgroundColor", &background_color_);
+ ParseFloat(*data, "backgroundDistance", &background_distance_);
+ data->GetBoolean("drawWebVr", &webvr_rendering_enabled_);
break;
}
}
@@ -357,14 +354,18 @@ ContentRectangle* UiScene::GetUiElementById(int element_id) {
return nullptr;
}
-const Colorf& UiScene::GetBackgroundColor() {
+const Colorf& UiScene::GetBackgroundColor() const {
return background_color_;
}
-float UiScene::GetBackgroundDistance() {
+float UiScene::GetBackgroundDistance() const {
return background_distance_;
}
+bool UiScene::GetWebVrRenderingEnabled() const {
+ return webvr_rendering_enabled_;
mthiesse 2017/03/20 17:32:16 This defaulting to false is going to dramatically
mthiesse 2017/03/20 17:38:33 Disregard this I misread.
+}
+
const std::vector<std::unique_ptr<ContentRectangle>>& UiScene::GetUiElements()
const {
return ui_elements_;

Powered by Google App Engine
This is Rietveld 408576698