New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 626899 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 699144
issue 716244



Sign in to add a comment

Update ui::UserActivityDetector to match mus UserActivityMonitor

Project Member Reported by sadrul@chromium.org, Jul 9 2016

Issue description

In current chrome, ui::UserActivityDetector (https://cs.chromium.org/chromium/src/ui/base/user_activity/user_activity_detector.h?sq=package:chromium&dr=CSs&rcl=1468048567&l=21) is used to detect when a user becomes idle/active.

In mus, this is done by UserActivityMonitor (https://cs.chromium.org/chromium/src/services/ui/public/interfaces/user_activity_monitor.mojom?sq=package:chromium&dr=CSs&rcl=1468048567&l=19 see  issue 623296  for more details).

To transition from the UserActivityDetector to UserActivityMonitor, we need to first convert the current ui::UserActivityObserver users to use the new mojom observer interfaces of UserActivityObserver and UserIdlenessObserver.

See https://docs.google.com/document/d/1RNzW4vbFjTQA44ILT_jqEf9MCJvxTPbrcmrcW9vYHng/edit# for more details about the current UserActivityObserver usage.
 
Cc: jamescook@chromium.org abodenha@chromium.org
Cc: -abodenha@chromium.org derat@chromium.org

Comment 3 by derat@chromium.org, Jul 11 2016

Status: Available (was: Assigned)
Components: Internals>MUS
Labels: Proj-Mustash

Comment 5 by derat@chromium.org, Jan 17 2017

Owner: derat@chromium.org
Status: Started (was: Available)
I'm investigating short-term approaches for forwarding user activity from UserActivityMonitor to ui::UserActivityDetector without needing to update all of the existing code that uses ui::UserActivityObserver.
Project Member

Comment 6 by bugdroid1@chromium.org, Jan 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/94887a2c9af708195be7560415090dd70eabd049

commit 94887a2c9af708195be7560415090dd70eabd049
Author: derat <derat@chromium.org>
Date: Fri Jan 20 18:17:25 2017

mus: Forward user activity from window server to detector.

Introduce an aura::UserActivityForwarder class that
receives reports of user activity from the window server via
mojo and forwards them to ui::UserActivityDetector so that
existing classes implementing ui::UserActivityObserver will
be notified.

This results in user activity being reported to the Chrome
OS power manager to prevent the display from being dimmed
and turned off.

BUG=626899

Review-Url: https://codereview.chromium.org/2639703004
Cr-Commit-Position: refs/heads/master@{#445095}

[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ash/shell.cc
[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ash/shell.h
[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/services/ui/manifest.json
[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/aura/BUILD.gn
[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/aura/mus/DEPS
[add] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/aura/mus/user_activity_forwarder.cc
[add] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/aura/mus/user_activity_forwarder.h
[add] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/aura/mus/user_activity_forwarder_unittest.cc
[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/aura/test/DEPS
[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/aura/test/run_all_unittests.cc
[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/base/user_activity/user_activity_detector.cc
[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/base/user_activity/user_activity_detector.h
[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/base/user_activity/user_activity_detector_unittest.cc
[modify] https://crrev.com/94887a2c9af708195be7560415090dd70eabd049/ui/chromeos/user_activity_power_manager_notifier.h

Comment 7 by derat@chromium.org, Jan 20 2017

We'll also need to instantiate ui::UserActivityDetector, ui::UserActivityPowerManagerNotifier, and ui::UserActivityForwarder in Chrome-on-mus. Right now, all three are instantiated by ash::Shell (the latter only for mash).

Much longer term, when mus is always available, classes that care about user activity/idleness should register themselves as observers of the UserActivityMonitor ws interface and receive notifications directly. Then UserActivityDetector and UserActivityForwarder can be removed.
Blocking: 699144

Comment 9 by xiy...@chromium.org, Apr 27 2017

Blocking: 716244
Components: -Internals>MUS Internals>Services>WindowService
Components: -MUS
Labels: -Proj-Mustash Proj-Mash-MultiProcess
This is still relevant, but only for multi-process mash.
Dan, re: comment 7, "mus" is now always available. (Code in //ash always provides the window service mojo APIs via //services/ui/ws2.) The "window service process" and "ash process" are now the same process. Could that simplify things?

(This came up while looking at ChromeBrowserMainExtraPartsAsh::PreProfileInit() today.)

Owner: ----
Status: Available (was: Started)
I'm unlikely to get to this in the near future, so marking it as up for grabs.

Sign in to add a comment