Chromium Code Reviews| 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 4ad96b4e4b73c4eacd9790cb7822221e71c628b9..10648c2835073f03ffe2ff9b2bcb8d23c582c6d1 100644 |
| --- a/chrome/browser/android/vr_shell/ui_interface.cc |
| +++ b/chrome/browser/android/vr_shell/ui_interface.cc |
| @@ -5,6 +5,7 @@ |
| #include "chrome/browser/android/vr_shell/ui_interface.h" |
| #include "chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.h" |
| +#include "url/gurl.h" |
| namespace vr_shell { |
| @@ -14,10 +15,6 @@ UiInterface::UiInterface() { |
| UiInterface::~UiInterface() {} |
| -void UiInterface::SetUiCommandHandler(UiCommandHandler* handler) { |
| - handler_ = handler; |
| -} |
| - |
| void UiInterface::SetMode(Mode mode) { |
| updates_.SetInteger("mode", static_cast<int>(mode)); |
| FlushUpdates(); |
| @@ -28,6 +25,20 @@ void UiInterface::SetSecureOrigin(bool secure) { |
| FlushUpdates(); |
| } |
| +void UiInterface::SetLoading(bool loading) { |
| + updates_.SetBoolean("loading", loading); |
| + FlushUpdates(); |
| +} |
| + |
| +void UiInterface::SetURL(const GURL& url) { |
| + std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue); |
| + details->SetString("host", url.host()); |
| + details->SetString("path", url.path()); |
| + |
| + updates_.Set("url", std::move(details)); |
| + FlushUpdates(); |
| +} |
| + |
| void UiInterface::OnDomContentsLoaded() { |
| loaded_ = true; |
| #if defined(ENABLE_VR_SHELL_UI_DEV) |
| @@ -36,6 +47,10 @@ void UiInterface::OnDomContentsLoaded() { |
| FlushUpdates(); |
| } |
| +void UiInterface::SetUiCommandHandler(UiCommandHandler* handler) { |
| + handler_ = handler; |
|
bshe
2016/10/27 20:27:44
Is the diff suppose to be here? The function was d
cjgrant
2016/10/28 14:16:58
This was intentional. I'm just moving the functio
bshe
2016/10/28 14:33:14
hah. I missed the deleted function..
|
| +} |
| + |
| void UiInterface::FlushUpdates() { |
| if (loaded_ && handler_) { |
| handler_->SendCommandToUi(updates_); |