| 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 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 FlushModeState(); | 31 FlushModeState(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void UiInterface::FlushModeState() { | 34 void UiInterface::FlushModeState() { |
| 35 updates_.SetInteger("mode", static_cast<int>(mode_)); | 35 updates_.SetInteger("mode", static_cast<int>(mode_)); |
| 36 updates_.SetBoolean("menuMode", menu_mode_); | 36 updates_.SetBoolean("menuMode", menu_mode_); |
| 37 updates_.SetBoolean("fullscreen", fullscreen_); | 37 updates_.SetBoolean("fullscreen", fullscreen_); |
| 38 FlushUpdates(); | 38 FlushUpdates(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void UiInterface::SetSecureOrigin(bool secure) { | 41 void UiInterface::SetSecurityLevel(int level) { |
| 42 updates_.SetBoolean("secureOrigin", secure); | 42 updates_.SetInteger("securityLevel", level); |
| 43 FlushUpdates(); | 43 FlushUpdates(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void UiInterface::SetWebVRSecureOrigin(bool secure) { |
| 47 updates_.SetBoolean("webVRSecureOrigin", secure); |
| 48 FlushUpdates(); |
| 49 } |
| 50 |
| 46 void UiInterface::SetLoading(bool loading) { | 51 void UiInterface::SetLoading(bool loading) { |
| 47 updates_.SetBoolean("loading", loading); | 52 updates_.SetBoolean("loading", loading); |
| 48 FlushUpdates(); | 53 FlushUpdates(); |
| 49 } | 54 } |
| 50 | 55 |
| 51 void UiInterface::SetURL(const GURL& url) { | 56 void UiInterface::SetURL(const GURL& url) { |
| 52 std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue); | 57 std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue); |
| 53 details->SetString("host", url.host()); | 58 details->SetString("host", url.host()); |
| 54 details->SetString("path", url.path()); | 59 details->SetString("path", url.path()); |
| 55 | 60 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 70 } | 75 } |
| 71 | 76 |
| 72 void UiInterface::FlushUpdates() { | 77 void UiInterface::FlushUpdates() { |
| 73 if (loaded_ && handler_) { | 78 if (loaded_ && handler_) { |
| 74 handler_->SendCommandToUi(updates_); | 79 handler_->SendCommandToUi(updates_); |
| 75 updates_.Clear(); | 80 updates_.Clear(); |
| 76 } | 81 } |
| 77 } | 82 } |
| 78 | 83 |
| 79 } // namespace vr_shell | 84 } // namespace vr_shell |
| OLD | NEW |