OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/values.h" |
| 10 |
| 11 class VrShellUIMessageHandler; |
| 12 |
| 13 namespace vr_shell { |
| 14 |
| 15 // This class manages the communication of browser state from VR shell to the |
| 16 // HTML UI. State information is asynchronous and unidirectional. |
| 17 class UiInterface { |
| 18 public: |
| 19 enum Mode { |
| 20 STANDARD, |
| 21 WEB_VR, |
| 22 }; |
| 23 |
| 24 UiInterface(); |
| 25 virtual ~UiInterface(); |
| 26 |
| 27 void SetMode(Mode mode); |
| 28 void SetSecureOrigin(bool secure); |
| 29 |
| 30 // Called by WebUI when starting VR. |
| 31 void OnDomContentsLoaded(); |
| 32 void SetUiMessageHandler(VrShellUIMessageHandler* handler); |
| 33 |
| 34 private: |
| 35 void FlushUpdates(); |
| 36 |
| 37 VrShellUIMessageHandler* handler_; |
| 38 bool loaded_ = false; |
| 39 base::DictionaryValue updates_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(UiInterface); |
| 42 }; |
| 43 |
| 44 } // namespace vr_shell |
| 45 |
| 46 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_ |
OLD | NEW |