Cc: derat@chromium.org Status: Started (was: Untriaged)
This is down to access to ash::PowerStatus, which I think can be replaced with direct usage of PowerManagerClient. I think it's just doing a UI refresh when power status changes. I'll take a look.
(This will make it easier to tighten DEPS in c/b/ui/webui, which is my goal here.)
Ugh, this is not simple. chrome/browser/ui/webui/settings/chromeos/device_power_handler.cc extensively uses ash::PowerStatus to get UI data and manipulate power state. We either need to:
1. Introduce an ash mojo API for power stuff, or
2. Migrate code down into PowerManagerClient (things that query the last proto for stuff like "is battery available") and maybe add some utility functions for things like battery string formatting to ash/public/cpp
I'm going to do the DEPS tightening first.
Could we just move PowerStatus into ash/public/cpp? It's a pretty thin wrapper on PowerManagerClient and its only dependencies on ash/ are resources (strings and vector icons).
Moving it sounds fine to me. IIRC it's really just a convenience wrapper around the PowerSupplyProperties protobuf, and both Chrome and and ash will have their own copies of the protobuf (received by PowerManagerClient from powerd).
Comment 1 by jamescook@chromium.org
, Aug 16 2017