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

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

Issue 2536873002: Clean up VR Shell mode transitions (and fix potential webvr startup race). (Closed)
Patch Set: Address comments Created 4 years, 1 month 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_interface.h ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/ui_interface.cc
diff --git a/chrome/browser/android/vr_shell/ui_interface.cc b/chrome/browser/android/vr_shell/ui_interface.cc
index 06c7e4d1f854e03b42cffecb3623b281e40c65a4..58acd54812431c9a8d28ddf13209c37456b46e7f 100644
--- a/chrome/browser/android/vr_shell/ui_interface.cc
+++ b/chrome/browser/android/vr_shell/ui_interface.cc
@@ -9,15 +9,31 @@
namespace vr_shell {
-UiInterface::UiInterface() {
- SetMode(Mode::STANDARD);
+UiInterface::UiInterface(Mode initial_mode) {
+ SetMode(initial_mode);
}
UiInterface::~UiInterface() {}
void UiInterface::SetMode(Mode mode) {
mode_ = mode;
- updates_.SetInteger("mode", static_cast<int>(mode));
+ FlushModeState();
+}
+
+void UiInterface::SetMenuMode(bool enabled) {
+ menu_mode_ = enabled;
+ FlushModeState();
+}
+
+void UiInterface::SetCinemaMode(bool enabled) {
+ cinema_mode_ = enabled;
+ FlushModeState();
+}
+
+void UiInterface::FlushModeState() {
+ updates_.SetInteger("mode", static_cast<int>(mode_));
+ updates_.SetBoolean("menuMode", menu_mode_);
+ updates_.SetBoolean("cinemaMode", cinema_mode_);
FlushUpdates();
}
« no previous file with comments | « chrome/browser/android/vr_shell/ui_interface.h ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698