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

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

Issue 2536873002: Clean up VR Shell mode transitions (and fix potential webvr startup race). (Closed)
Patch Set: Update javascript Mode enum Created 4 years 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(Mode initial_mode) {
13 SetMode(Mode::STANDARD); 13 SetMode(initial_mode);
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 mode_ = mode;
20 updates_.SetInteger("mode", static_cast<int>(mode)); 20 updates_.SetInteger("mode", static_cast<int>(mode));
21 FlushUpdates(); 21 FlushUpdates();
22 } 22 }
23 23
(...skipping 29 matching lines...) Expand all
53 } 53 }
54 54
55 void UiInterface::FlushUpdates() { 55 void UiInterface::FlushUpdates() {
56 if (loaded_ && handler_) { 56 if (loaded_ && handler_) {
57 handler_->SendCommandToUi(updates_); 57 handler_->SendCommandToUi(updates_);
58 updates_.Clear(); 58 updates_.Clear();
59 } 59 }
60 } 60 }
61 61
62 } // namespace vr_shell 62 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698