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

Unified Diff: chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc

Issue 2428383006: Decouple VR Shell DPR and CSS size from Physical Displays. (Closed)
Patch Set: Address bshe comments + minor fix Created 4 years 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/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
diff --git a/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc b/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
index 7eb33f110f6836998ec784e8f325605d9862e22a..02ec68557e732153f2b1086a1f6641632ffc93a6 100644
--- a/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
+++ b/chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc
@@ -35,6 +35,9 @@ void VrShellUIMessageHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback(
"doAction", base::Bind(&VrShellUIMessageHandler::HandleDoAction,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "setUiCssSize", base::Bind(&VrShellUIMessageHandler::HandleSetUiCssSize,
+ base::Unretained(this)));
}
void VrShellUIMessageHandler::HandleDomLoaded(const base::ListValue* args) {
@@ -72,6 +75,17 @@ void VrShellUIMessageHandler::HandleDoAction(const base::ListValue* args) {
}
}
+void VrShellUIMessageHandler::HandleSetUiCssSize(const base::ListValue* args) {
+ CHECK(args->GetSize() == 3);
+ double width, height, dpr;
+ CHECK(args->GetDouble(0, &width));
+ CHECK(args->GetDouble(1, &height));
+ CHECK(args->GetDouble(2, &dpr));
+ if (vr_shell_) {
+ vr_shell_->SetUiCssSize(width, height, dpr);
+ }
+}
+
void VrShellUIMessageHandler::SendCommandToUi(const base::Value& value) {
CallJavascriptFunction("vrShellUi.command", value);
}

Powered by Google App Engine
This is Rietveld 408576698