| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "chrome/browser/android/vr_shell/vr_omnibox.h" | 11 #include "chrome/browser/android/vr_shell/vr_omnibox.h" |
| 12 #include "chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.h" | 12 #include "chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.h" |
| 13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 14 | 14 |
| 15 namespace vr_shell { | 15 namespace vr_shell { |
| 16 | 16 |
| 17 UiInterface::UiInterface(Mode initial_mode, bool fullscreen) | 17 UiInterface::UiInterface(Mode initial_mode) |
| 18 : omnibox_(base::MakeUnique<VrOmnibox>(this)) { | 18 : omnibox_(base::MakeUnique<VrOmnibox>(this)) { |
| 19 SetMode(initial_mode); | 19 SetMode(initial_mode); |
| 20 SetFullscreen(fullscreen); | |
| 21 } | 20 } |
| 22 | 21 |
| 23 UiInterface::~UiInterface() {} | 22 UiInterface::~UiInterface() {} |
| 24 | 23 |
| 25 void UiInterface::SetMode(Mode mode) { | 24 void UiInterface::SetMode(Mode mode) { |
| 26 mode_ = mode; | 25 mode_ = mode; |
| 27 FlushModeState(); | 26 FlushModeState(); |
| 28 } | 27 } |
| 29 | 28 |
| 30 void UiInterface::SetFullscreen(bool enabled) { | 29 void UiInterface::SetFullscreen(bool enabled) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 128 } |
| 130 | 129 |
| 131 void UiInterface::FlushUpdates() { | 130 void UiInterface::FlushUpdates() { |
| 132 if (loaded_ && handler_) { | 131 if (loaded_ && handler_) { |
| 133 handler_->SendCommandToUi(updates_); | 132 handler_->SendCommandToUi(updates_); |
| 134 updates_.Clear(); | 133 updates_.Clear(); |
| 135 } | 134 } |
| 136 } | 135 } |
| 137 | 136 |
| 138 } // namespace vr_shell | 137 } // namespace vr_shell |
| OLD | NEW |