New issue
Advanced search Search tips

Issue 644361 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 629707



Sign in to add a comment

mash dbus: Support system clock

Project Member Reported by jamescook@chromium.org, Sep 6 2016

Issue description

go/dbus-in-mustash

See SystemClockClient

Communicates with system clock. Used in chrome (time setting webui) and ash (system tray).

Plan: Fix to support D-Bus communication with multiple clients.

 
Owner: jamescook@chromium.org
Status: Started (was: Untriaged)
I'll take a look at this.

This is mostly an audit / cleanup pass, as the clock seems to be working OK in mustash right now.

I think this will mostly work as-is. Both browser and ash processes can bring up the SystemClockClient D-Bus client. That client doesn't have any significant internal state.

Browser uses the client directly from //chrome/browser/ui/webui/options/chromeos/ for date/time setting. Ash uses it from //ash/common/system/chromeos/system_clock_observer.h, which is only used in //ash.

The one thing that needs to be fixed for mustash is the 12-hour vs 24-hour setting. It comes via SystemTrayDelegate, which doesn't have a mus impl yet. The value is based on login state, system clock state, "crossettings" for machine state, user prefs, and other dependencies that only exist in the browser.

See OnSystemClockChanged() in SystemTrayDelegateChromeOS: 
https://cs.chromium.org/chromium/src/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc?l=964
Project Member

Comment 3 by bugdroid1@chromium.org, Sep 20 2016

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

commit 6763ee8aaac990f173b64a17cf0e29b914fc94ce
Author: jamescook <jamescook@chromium.org>
Date: Tue Sep 20 16:48:13 2016

mash: Fix system tray clock 12/24 hour time setting

The 12 vs. 24 hour time preference comes from chrome browser because it
depends on prefs, machine settings, login state, etc.

* Add ash.mojom.SystemTray interface
* Add SystemTrayControllerMus in //chrome which listens for 12/24 pref updates
and sends them to ash over mojo
* Add SystemTrayDelegateMus in //ash/mus which listens for time pref updates
over mojo and routes them to the system tray
* SystemTrayDelegateMus caches the 12/24 preference as it is queried
synchronously elsewhere in ash

BUG=644361
TEST=open settings > advanced settings, toggle 24 hour clock preference, system
tray display updates itself

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

[modify] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/ash/mus/BUILD.gn
[modify] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/ash/mus/bridge/wm_shell_mus.cc
[modify] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/ash/mus/shell_delegate_mus.cc
[add] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/ash/mus/system_tray_delegate_mus.cc
[add] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/ash/mus/system_tray_delegate_mus.h
[modify] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/ash/mus/window_manager_application.cc
[modify] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/ash/mus/window_manager_application.h
[modify] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/ash/public/interfaces/BUILD.gn
[add] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/ash/public/interfaces/system_tray.mojom
[modify] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/chrome/app/mojo/chrome_manifest.json
[modify] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/chrome/browser/ui/BUILD.gn
[add] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/chrome/browser/ui/ash/system_tray_controller_mus.cc
[add] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/chrome/browser/ui/ash/system_tray_controller_mus.h
[modify] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc
[modify] https://crrev.com/6763ee8aaac990f173b64a17cf0e29b914fc94ce/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h

Status: Fixed (was: Started)
Done, modulo any bugs we find.

Status: Assigned (was: Fixed)
Not done. ash still accesses //chromeos/settings/timezone_settings.h and settings probably will live in the browser process under mustash. This needs more investigation.

Labels: Proj-Mustash
Components: Internals>MUS
Cc: jamescook@chromium.org
Owner: ----
Status: Untriaged (was: Assigned)
We don't need the last bits of timezone support for Q1. Back in the pile.

Components: -Internals>MUS Internals>Services>WindowService
Components: -MUS
Components: -Internals>Services>WindowService Internals>Services>Ash
Labels: -Proj-Mustash-Mash
Labels: -Proj-Mustash Proj-Mash-MultiProcess
Owner: steve...@chromium.org
Status: Assigned (was: Untriaged)
One more.
Ash has two clock related dependencies, both in clock_model.h:

#include "chromeos/dbus/system_clock_client.h"
#include "chromeos/settings/timezone_settings.h"

The TimezoneSettings dependency include CrosSettingsProvider dependencies, so
it makes sense for both of these to be part of the Chrome process (which already
has multiple TimezoneSettings dependencies).

We should be able to replace both of those with with a single time related mojo
API.

IIRC the TimezoneSettings thing is a one-off CrosSettingsProvider. Eliminating it would simplify CrosSettings. OTOH I think that's a pretty big refactor.
Cc: olsen@chromium.org
Yeah, I've looked into that before. It's.... complicated. Probably worth re-examining however, thanks for the reminder.


Sign in to add a comment