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

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

Issue 2434013002: Implement a means of letting native VR Shell control the HTML UI. (Closed)
Patch Set: Remove use of cr.define() Created 4 years, 2 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/BUILD.gn ('k') | chrome/browser/android/vr_shell/ui_interface.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_interface.h
diff --git a/chrome/browser/android/vr_shell/ui_interface.h b/chrome/browser/android/vr_shell/ui_interface.h
new file mode 100644
index 0000000000000000000000000000000000000000..a0c5c5069640ec008dbfd2c6f9b9fce8ffa13b95
--- /dev/null
+++ b/chrome/browser/android/vr_shell/ui_interface.h
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_
+#define CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_
+
+#include "base/macros.h"
+#include "base/values.h"
+
+class VrShellUIMessageHandler;
+
+namespace vr_shell {
+
+// This class manages the communication of browser state from VR shell to the
+// HTML UI. State information is asynchronous and unidirectional.
+class UiInterface {
+ public:
+ enum Mode {
+ STANDARD,
+ WEB_VR,
+ };
+
+ UiInterface();
+ virtual ~UiInterface();
+
+ void SetMode(Mode mode);
+ void SetSecureOrigin(bool secure);
+
+ // Called by WebUI when starting VR.
+ void OnDomContentsLoaded();
+ void SetUiMessageHandler(VrShellUIMessageHandler* handler);
+
+ private:
+ void FlushUpdates();
+
+ VrShellUIMessageHandler* handler_;
+ bool loaded_ = false;
+ base::DictionaryValue updates_;
+
+ DISALLOW_COPY_AND_ASSIGN(UiInterface);
+};
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_
« no previous file with comments | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/ui_interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698