In SessionStateDelegate, consider renaming ShouldLockScreenBeforeSuspending to ShouldLockScreenIfRequired or ShouldLockScreenIfRequiredInPref.
For two reasons:
(1) In the implementation, https://cs.chromium.org/chromium/src/chrome/browser/ui/ash/session_state_delegate_chromeos.cc?dr=CSs&sq=package:chromium&rcl=1477021054&l=106, I don't see the function body is related to "before suspending". It should also be used in other cases, just like (2).
(2) In tablet power button behavior feature ( crbug.com/633304 ), a power button tap should check ShouldLockScreenIfRequired (Require password to wake from sleep), and then lock the screen if it is required.
What do you think? The other solution might be exposing another api for tablet power button tap. And both of them use the same helper method. But I don't think it is necessary.
Comment 1 by derat@chromium.org
, Oct 21 2016Labels: OS-Chrome