Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Side by Side Diff: chrome/browser/android/vr_shell/ui_interface.cc

Issue 2471433002: Implement WebVR presentation pausing for VR Shell Menu Mode (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_interface.h ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698