| 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 "content/public/browser/web_ui_message_handler.h" | 10 #include "content/public/browser/web_ui_message_handler.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class ListValue; | 13 class ListValue; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace vr_shell { | 16 namespace vr_shell { |
| 17 class VrShell; | 17 class VrShell; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class VrShellUIMessageHandler : public content::WebUIMessageHandler { | 20 class VrShellUIMessageHandler : public content::WebUIMessageHandler { |
| 21 public: | 21 public: |
| 22 VrShellUIMessageHandler(); | 22 VrShellUIMessageHandler(); |
| 23 ~VrShellUIMessageHandler() override; | 23 ~VrShellUIMessageHandler() override; |
| 24 | 24 |
| 25 void SendCommandToUi(const base::Value& value); |
| 26 |
| 25 private: | 27 private: |
| 26 // content::WebUIMessageHandler: | 28 // content::WebUIMessageHandler: |
| 27 void RegisterMessages() override; | 29 void RegisterMessages() override; |
| 30 void OnJavascriptAllowed() override; |
| 28 | 31 |
| 29 void HandleDomLoaded(const base::ListValue* args); | 32 void HandleDomLoaded(const base::ListValue* args); |
| 30 void HandleUpdateScene(const base::ListValue* args); | 33 void HandleUpdateScene(const base::ListValue* args); |
| 31 void HandleDoAction(const base::ListValue* args); | 34 void HandleDoAction(const base::ListValue* args); |
| 32 | 35 |
| 33 base::WeakPtr<vr_shell::VrShell> vr_shell_; | 36 base::WeakPtr<vr_shell::VrShell> vr_shell_; |
| 34 | 37 |
| 35 DISALLOW_COPY_AND_ASSIGN(VrShellUIMessageHandler); | 38 DISALLOW_COPY_AND_ASSIGN(VrShellUIMessageHandler); |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 #endif // CHROME_BROWSER_UI_WEBUI_VR_SHELL_VR_SHELL_UI_MESSAGE_HANDLER_H_ | 41 #endif // CHROME_BROWSER_UI_WEBUI_VR_SHELL_VR_SHELL_UI_MESSAGE_HANDLER_H_ |
| OLD | NEW |