| 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 #include "chrome/browser/android/vr_shell/ui_interface.h" | 5 #include "chrome/browser/android/vr_shell/ui_interface.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.h" | 7 #include "chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.h" |
| 8 #include "url/gurl.h" | 8 #include "url/gurl.h" |
| 9 | 9 |
| 10 namespace vr_shell { | 10 namespace vr_shell { |
| 11 | 11 |
| 12 UiInterface::UiInterface() { | 12 UiInterface::UiInterface() { |
| 13 SetMode(Mode::STANDARD); | 13 SetMode(Mode::STANDARD); |
| 14 } | 14 } |
| 15 | 15 |
| 16 UiInterface::~UiInterface() {} | 16 UiInterface::~UiInterface() {} |
| 17 | 17 |
| 18 void UiInterface::SetMode(Mode mode) { | 18 void UiInterface::SetMode(Mode mode) { |
| 19 mode_ = mode; |
| 19 updates_.SetInteger("mode", static_cast<int>(mode)); | 20 updates_.SetInteger("mode", static_cast<int>(mode)); |
| 20 FlushUpdates(); | 21 FlushUpdates(); |
| 21 } | 22 } |
| 22 | 23 |
| 23 void UiInterface::SetSecureOrigin(bool secure) { | 24 void UiInterface::SetSecureOrigin(bool secure) { |
| 24 updates_.SetBoolean("secureOrigin", secure); | 25 updates_.SetBoolean("secureOrigin", secure); |
| 25 FlushUpdates(); | 26 FlushUpdates(); |
| 26 } | 27 } |
| 27 | 28 |
| 28 void UiInterface::SetLoading(bool loading) { | 29 void UiInterface::SetLoading(bool loading) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 52 } | 53 } |
| 53 | 54 |
| 54 void UiInterface::FlushUpdates() { | 55 void UiInterface::FlushUpdates() { |
| 55 if (loaded_ && handler_) { | 56 if (loaded_ && handler_) { |
| 56 handler_->SendCommandToUi(updates_); | 57 handler_->SendCommandToUi(updates_); |
| 57 updates_.Clear(); | 58 updates_.Clear(); |
| 58 } | 59 } |
| 59 } | 60 } |
| 60 | 61 |
| 61 } // namespace vr_shell | 62 } // namespace vr_shell |
| OLD | NEW |