OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_VR_SHELL_VR_SHELL_UI_MESSAGE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_VR_SHELL_VR_SHELL_UI_MESSAGE_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_VR_SHELL_VR_SHELL_UI_MESSAGE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_VR_SHELL_VR_SHELL_UI_MESSAGE_HANDLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "chrome/browser/android/vr_shell/ui_interface.h" |
10 #include "content/public/browser/web_ui_message_handler.h" | 11 #include "content/public/browser/web_ui_message_handler.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class ListValue; | 14 class ListValue; |
14 } | 15 } |
15 | 16 |
16 namespace vr_shell { | 17 namespace vr_shell { |
17 class VrShell; | 18 class VrShell; |
18 } | 19 } |
19 | 20 |
20 class VrShellUIMessageHandler : public content::WebUIMessageHandler { | 21 class VrShellUIMessageHandler : public content::WebUIMessageHandler, |
| 22 public vr_shell::UiCommandHandler { |
21 public: | 23 public: |
22 VrShellUIMessageHandler(); | 24 VrShellUIMessageHandler(); |
23 ~VrShellUIMessageHandler() override; | 25 ~VrShellUIMessageHandler() override; |
24 | 26 |
25 void SendCommandToUi(const base::Value& value); | 27 void SendCommandToUi(const base::Value& value) override; |
26 | 28 |
27 private: | 29 private: |
28 // content::WebUIMessageHandler: | 30 // content::WebUIMessageHandler: |
29 void RegisterMessages() override; | 31 void RegisterMessages() override; |
30 void OnJavascriptAllowed() override; | 32 void OnJavascriptAllowed() override; |
31 | 33 |
32 void HandleDomLoaded(const base::ListValue* args); | 34 void HandleDomLoaded(const base::ListValue* args); |
33 void HandleUpdateScene(const base::ListValue* args); | 35 void HandleUpdateScene(const base::ListValue* args); |
34 void HandleDoAction(const base::ListValue* args); | 36 void HandleDoAction(const base::ListValue* args); |
35 | 37 |
36 base::WeakPtr<vr_shell::VrShell> vr_shell_; | 38 base::WeakPtr<vr_shell::VrShell> vr_shell_; |
37 | 39 |
38 DISALLOW_COPY_AND_ASSIGN(VrShellUIMessageHandler); | 40 DISALLOW_COPY_AND_ASSIGN(VrShellUIMessageHandler); |
39 }; | 41 }; |
40 | 42 |
41 #endif // CHROME_BROWSER_UI_WEBUI_VR_SHELL_VR_SHELL_UI_MESSAGE_HANDLER_H_ | 43 #endif // CHROME_BROWSER_UI_WEBUI_VR_SHELL_VR_SHELL_UI_MESSAGE_HANDLER_H_ |
OLD | NEW |