lgtm https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/ui_interface.h File chrome/browser/android/vr_shell/ui_interface.h (right): https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/ui_interface.h#newcode28 chrome/browser/android/vr_shell/ui_interface.h:28: STANDARD_MENU, nit: can you add comments about the ...
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
File chrome/browser/android/vr_shell/vr_shell.cc (right):
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
chrome/browser/android/vr_shell/vr_shell.cc:359: switch
(html_interface_->GetMode()) {
This block looks odd to me for a few reasons:
- We're asking the HTML interface what mode it's in, when we set its mode (I
think this is for convenience).
- I don't see why there should be separate modes for menu-in-WebVR and
menu-standard. Why not independently tell the UI about (1) webVR mode, (2) menu
active, and (3) cinema mode? Then this logic ends up as "invert menu mode state
in the UI". I think the same may be true for CINEMA MODE - it feels more like a
boolean that would influence how the UI draws Standard mode, not a mode of its
own. Otherwise, won't we have CINEMA_MENU as well?
I picture vrShell keeping track of these states, and then:
html_interface_->SetMode(STANDARD);
html_interface_->SetCinema(true/false);
html_interface_->SetMenuMode(true/false);
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/vr_shell.cc#newcode168 chrome/browser/android/vr_shell/vr_shell.cc:168: metrics_helper_->SetWebVREnabled(true); Doesn't this need to be set to false ...
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
File chrome/browser/android/vr_shell/vr_shell.cc (right):
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
chrome/browser/android/vr_shell/vr_shell.cc:168:
metrics_helper_->SetWebVREnabled(true);
Doesn't this need to be set to false in the non-webvr case? Why put it behind
an if block instead of just passing in for_web_vr?
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
chrome/browser/android/vr_shell/vr_shell.cc:359: switch
(html_interface_->GetMode()) {
On 2016/11/28 22:21:09, cjgrant wrote:
> This block looks odd to me for a few reasons:
> - We're asking the HTML interface what mode it's in, when we set its mode (I
> think this is for convenience).
> - I don't see why there should be separate modes for menu-in-WebVR and
> menu-standard. Why not independently tell the UI about (1) webVR mode, (2)
menu
> active, and (3) cinema mode? Then this logic ends up as "invert menu mode
state
> in the UI". I think the same may be true for CINEMA MODE - it feels more like
a
> boolean that would influence how the UI draws Standard mode, not a mode of its
> own. Otherwise, won't we have CINEMA_MENU as well?
>
> I picture vrShell keeping track of these states, and then:
> html_interface_->SetMode(STANDARD);
> html_interface_->SetCinema(true/false);
> html_interface_->SetMenuMode(true/false);
+1 to trying to model this differently. The TODO below on line 376 looks like
it would be addressed by creating a CINEMA_MENU mode with the implementation in
this patch.
mthiesse
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/ui_interface.h File chrome/browser/android/vr_shell/ui_interface.h (right): https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/ui_interface.h#newcode28 chrome/browser/android/vr_shell/ui_interface.h:28: STANDARD_MENU, On 2016/11/28 22:15:07, bshe wrote: > nit: can ...
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
File chrome/browser/android/vr_shell/ui_interface.h (right):
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
chrome/browser/android/vr_shell/ui_interface.h:28: STANDARD_MENU,
On 2016/11/28 22:15:07, bshe wrote:
> nit: can you add comments about the two new enum? It is not obvious why we
need
> STARND and WEBVR menu be different.
Acknowledged.
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
File chrome/browser/android/vr_shell/vr_shell.cc (right):
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
chrome/browser/android/vr_shell/vr_shell.cc:359: switch
(html_interface_->GetMode()) {
On 2016/11/28 22:21:09, cjgrant wrote:
> This block looks odd to me for a few reasons:
> - We're asking the HTML interface what mode it's in, when we set its mode (I
> think this is for convenience).
> - I don't see why there should be separate modes for menu-in-WebVR and
> menu-standard. Why not independently tell the UI about (1) webVR mode, (2)
menu
> active, and (3) cinema mode? Then this logic ends up as "invert menu mode
state
> in the UI". I think the same may be true for CINEMA MODE - it feels more like
a
> boolean that would influence how the UI draws Standard mode, not a mode of its
> own. Otherwise, won't we have CINEMA_MENU as well?
>
> I picture vrShell keeping track of these states, and then:
> html_interface_->SetMode(STANDARD);
> html_interface_->SetCinema(true/false);
> html_interface_->SetMenuMode(true/false);
Well okay Mr. "I care about long term health", I guuuessss if you insist on
writing good code.
(Chris was worried he was lobbing a grenade here ;))
mthiesse
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/vr_shell.cc#newcode168 chrome/browser/android/vr_shell/vr_shell.cc:168: metrics_helper_->SetWebVREnabled(true); On 2016/11/28 23:09:49, amp wrote: > Doesn't this ...
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
File chrome/browser/android/vr_shell/vr_shell.cc (right):
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
chrome/browser/android/vr_shell/vr_shell.cc:168:
metrics_helper_->SetWebVREnabled(true);
On 2016/11/28 23:09:49, amp wrote:
> Doesn't this need to be set to false in the non-webvr case? Why put it behind
> an if block instead of just passing in for_web_vr?
I would think not, because we're not setting WebVR mode at all here. Presumably
a SetWebVREnabled(false) should only ever follow a SetWebVREnabled(true), or
else what are we actually trying to measure here?
billorr
lgtm https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/vr_shell.cc#newcode168 chrome/browser/android/vr_shell/vr_shell.cc:168: metrics_helper_->SetWebVREnabled(true); On 2016/11/28 23:30:12, mthiesse wrote: > On ...
lgtm
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
File chrome/browser/android/vr_shell/vr_shell.cc (right):
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
chrome/browser/android/vr_shell/vr_shell.cc:168:
metrics_helper_->SetWebVREnabled(true);
On 2016/11/28 23:30:12, mthiesse wrote:
> On 2016/11/28 23:09:49, amp wrote:
> > Doesn't this need to be set to false in the non-webvr case? Why put it
behind
> > an if block instead of just passing in for_web_vr?
>
> I would think not, because we're not setting WebVR mode at all here.
Presumably
> a SetWebVREnabled(false) should only ever follow a SetWebVREnabled(true), or
> else what are we actually trying to measure here?
It defaults to false, so we should only need this when we enter webvr mode.
That said, passing it in won't hurt.
lgtm
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
File chrome/browser/android/vr_shell/vr_shell.cc (right):
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
chrome/browser/android/vr_shell/vr_shell.cc:359: switch
(html_interface_->GetMode()) {
On 2016/11/28 23:28:34, mthiesse wrote:
> On 2016/11/28 22:21:09, cjgrant wrote:
> > This block looks odd to me for a few reasons:
> > - We're asking the HTML interface what mode it's in, when we set its mode (I
> > think this is for convenience).
> > - I don't see why there should be separate modes for menu-in-WebVR and
> > menu-standard. Why not independently tell the UI about (1) webVR mode, (2)
> menu
> > active, and (3) cinema mode? Then this logic ends up as "invert menu mode
> state
> > in the UI". I think the same may be true for CINEMA MODE - it feels more
like
> a
> > boolean that would influence how the UI draws Standard mode, not a mode of
its
> > own. Otherwise, won't we have CINEMA_MENU as well?
> >
> > I picture vrShell keeping track of these states, and then:
> > html_interface_->SetMode(STANDARD);
> > html_interface_->SetCinema(true/false);
> > html_interface_->SetMenuMode(true/false);
>
> Well okay Mr. "I care about long term health", I guuuessss if you insist on
> writing good code.
>
> (Chris was worried he was lobbing a grenade here ;))
LOL!
mthiesse
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/vr_shell/vr_shell.cc#newcode168 chrome/browser/android/vr_shell/vr_shell.cc:168: metrics_helper_->SetWebVREnabled(true); On 2016/11/29 00:05:31, billorr wrote: > On 2016/11/28 ...
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
File chrome/browser/android/vr_shell/vr_shell.cc (right):
https://codereview.chromium.org/2536873002/diff/20001/chrome/browser/android/...
chrome/browser/android/vr_shell/vr_shell.cc:168:
metrics_helper_->SetWebVREnabled(true);
On 2016/11/29 00:05:31, billorr wrote:
> On 2016/11/28 23:30:12, mthiesse wrote:
> > On 2016/11/28 23:09:49, amp wrote:
> > > Doesn't this need to be set to false in the non-webvr case? Why put it
> behind
> > > an if block instead of just passing in for_web_vr?
> >
> > I would think not, because we're not setting WebVR mode at all here.
> Presumably
> > a SetWebVREnabled(false) should only ever follow a SetWebVREnabled(true), or
> > else what are we actually trying to measure here?
>
> It defaults to false, so we should only need this when we enter webvr mode.
> That said, passing it in won't hurt.
Ah, I didn't know that was how it worked. I'm going to leave this as-is for now,
unless somebody prefers "metrics_helper_->SetWebVREnabled(for_web_vr)", but I
think that's slightly misleading.
That said, it seems we're not calling metrics_helper_->SetWebVREnabled(false) in
all cases where we exit webVR. Do we also want to call it when we exit webVR by
tearing down VR Shell (i.e. when we press the system back button to exit VR)?
Right now it's only called when the site explicitly fires a stop presenting
call, or something else blink-side kicks us out of presentation.
Issue 2536873002: Clean up VR Shell mode transitions (and fix potential webvr startup race).
(Closed)
Created 4 years ago by mthiesse
Modified 4 years ago
Reviewers: bshe, cjgrant, billorr, amp
Base URL:
Comments: 10