Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Issue 2497123002: chromeos: Move device shutdown handling out of chrome into ash (Closed)

Created:
4 years, 1 month ago by James Cook
Modified:
4 years, 1 month ago
Reviewers:
Tom Sepez, Daniel Erat, sky
CC:
chromium-reviews, alemate+watch_chromium.org, sadrul, qsr+mojo_chromium.org, derat+watch_chromium.org, viettrungluu+watch_chromium.org, achuith+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, oshima+watch_chromium.org, kalyank, darin (slow to review), davemoore+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

chromeos: Move device shutdown handling out of chrome into ash Historically device shutdown was handled in chrome because it needed to check a device "reboot on shutdown" policy during the shutdown process. Under mustash it is possible to quit the chrome browser and leave ash running, but the old code required launching chrome in order to shut down. Moving the code into ash also reduces ash/chrome dependencies and simplifies the SystemTrayDelegate code I'm trying to refactor. * The system tray shutdown button computes its "shutdown" vs "reboot" each time the menu is opened. It no longer changes its tooltip if the policy changed while the menu was open. The old behavior seemed unnecessary, and doing it this way avoids a set of policy observers in ash. * Chrome observes the shutdown policy via ShutdownPolicyHandler. It sends the initial value to ash via the ash::mojom::ShutdownController mojo interface. Subsequent policy updates are sent over the same interface. This partially reverts the ShutdownClient implementation introduced in https://codereview.chromium.org/2471643002 BUG=647412, 628792 TEST=ash_unittests, chrome unit_tests and browser_tests (ShutdownPolicy*) and manual testing on device Committed: https://crrev.com/d9f152f1d2e35a35a726a3891c00a764de144b39 Cr-Commit-Position: refs/heads/master@{#432035}

Patch Set 1 #

Total comments: 5

Patch Set 2 : review comments #

Patch Set 3 : non-exported base, using chromeos #

Patch Set 4 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+347 lines, -535 lines) Patch
M ash/BUILD.gn View 1 2 3 3 chunks +2 lines, -3 lines 0 comments Download
M ash/common/mojo_interface_factory.cc View 3 chunks +8 lines, -0 lines 0 comments Download
A ash/common/shutdown_controller.h View 1 2 1 chunk +49 lines, -0 lines 0 comments Download
A ash/common/shutdown_controller.cc View 1 2 1 chunk +47 lines, -0 lines 0 comments Download
D ash/common/system/chromeos/shutdown_policy_observer.h View 1 chunk +0 lines, -24 lines 0 comments Download
M ash/common/system/date/date_default_view.h View 4 chunks +1 line, -9 lines 0 comments Download
M ash/common/system/date/date_default_view.cc View 5 chunks +8 lines, -23 lines 0 comments Download
M ash/common/system/tiles/tiles_default_view.h View 4 chunks +1 line, -9 lines 0 comments Download
M ash/common/system/tiles/tiles_default_view.cc View 4 chunks +8 lines, -24 lines 0 comments Download
M ash/common/system/tiles/tray_tiles.h View 1 chunk +1 line, -0 lines 0 comments Download
M ash/common/system/tiles/tray_tiles.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M ash/common/system/tray/system_tray_delegate.h View 3 chunks +0 lines, -15 lines 0 comments Download
M ash/common/system/tray/system_tray_delegate.cc View 1 chunk +0 lines, -9 lines 0 comments Download
M ash/common/wm_shell.h View 3 chunks +6 lines, -0 lines 0 comments Download
M ash/common/wm_shell.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M ash/mus/manifest.json View 1 chunk +1 line, -0 lines 0 comments Download
M ash/public/interfaces/shutdown.mojom View 1 chunk +7 lines, -9 lines 0 comments Download
M ash/shell.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ash/test/BUILD.gn View 1 chunk +0 lines, -2 lines 0 comments Download
M ash/test/lock_state_controller_test_api.h View 1 chunk +3 lines, -1 line 0 comments Download
M ash/test/lock_state_controller_test_api.cc View 1 chunk +0 lines, -5 lines 0 comments Download
D ash/test/test_shutdown_client.h View 1 chunk +0 lines, -35 lines 0 comments Download
D ash/test/test_shutdown_client.cc View 1 chunk +0 lines, -19 lines 0 comments Download
M ash/wm/lock_state_controller.h View 1 3 chunks +4 lines, -10 lines 0 comments Download
M ash/wm/lock_state_controller.cc View 1 4 chunks +7 lines, -21 lines 0 comments Download
M ash/wm/lock_state_controller_unittest.cc View 1 7 chunks +21 lines, -8 lines 0 comments Download
D ash/wm/shutdown_client_proxy.h View 1 chunk +0 lines, -37 lines 0 comments Download
D ash/wm/shutdown_client_proxy.cc View 1 chunk +0 lines, -23 lines 0 comments Download
M chrome/app/mash/chrome_mash_content_browser_manifest_overlay.json View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/chrome_content_browser_manifest_overlay.json View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/chromeos/BUILD.gn View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/chrome_browser_main_chromeos.h View 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/chromeos/chrome_browser_main_chromeos.cc View 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/chrome_interface_factory.cc View 4 chunks +3 lines, -12 lines 0 comments Download
D chrome/browser/chromeos/power/shutdown_client_impl.h View 1 chunk +0 lines, -30 lines 0 comments Download
D chrome/browser/chromeos/power/shutdown_client_impl.cc View 1 chunk +0 lines, -38 lines 0 comments Download
A chrome/browser/chromeos/settings/shutdown_policy_forwarder.h View 1 chunk +30 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/settings/shutdown_policy_forwarder.cc View 1 chunk +43 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/settings/shutdown_policy_handler.h View 2 chunks +4 lines, -15 lines 0 comments Download
M chrome/browser/chromeos/settings/shutdown_policy_handler.cc View 1 chunk +10 lines, -26 lines 0 comments Download
M chrome/browser/chromeos/settings/shutdown_policy_handler_unittest.cc View 3 chunks +13 lines, -30 lines 0 comments Download
M chrome/browser/chromeos/shutdown_policy_browsertest.cc View 1 chunk +44 lines, -48 lines 0 comments Download
M chrome/browser/ui/ash/system_tray_delegate_chromeos.h View 1 2 3 5 chunks +0 lines, -14 lines 0 comments Download
M chrome/browser/ui/ash/system_tray_delegate_chromeos.cc View 1 2 3 5 chunks +0 lines, -26 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/login/oobe_ui.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/chromeos/login/oobe_ui.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 22 (13 generated)
James Cook
Dan, please take a look. Apologies for the size, but at least it's net negative! ...
4 years, 1 month ago (2016-11-12 01:32:18 UTC) #4
Daniel Erat
lgtm! https://codereview.chromium.org/2497123002/diff/1/ash/common/shutdown_controller.h File ash/common/shutdown_controller.h (right): https://codereview.chromium.org/2497123002/diff/1/ash/common/shutdown_controller.h#newcode27 ash/common/shutdown_controller.h:27: virtual void ShutdownOrReboot(); nit: ShutDownOrReboot ("shut down" is ...
4 years, 1 month ago (2016-11-14 15:42:41 UTC) #7
James Cook
Thanks for the quick review. https://codereview.chromium.org/2497123002/diff/1/ash/common/shutdown_controller.h File ash/common/shutdown_controller.h (right): https://codereview.chromium.org/2497123002/diff/1/ash/common/shutdown_controller.h#newcode27 ash/common/shutdown_controller.h:27: virtual void ShutdownOrReboot(); On ...
4 years, 1 month ago (2016-11-14 17:21:39 UTC) #8
James Cook
tsepez and sky, can I get OWNERS for these files? tsepez: ash/public/interfaces/shutdown.mojom sky: chrome/app/mash/chrome_mash_content_browser_manifest_overlay.json chrome/browser/chrome_content_browser_manifest_overlay.json ...
4 years, 1 month ago (2016-11-14 17:28:01 UTC) #12
Tom Sepez
OWNERS LGTM
4 years, 1 month ago (2016-11-14 18:02:15 UTC) #13
sky
LGTM
4 years, 1 month ago (2016-11-14 21:41:37 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2497123002/60001
4 years, 1 month ago (2016-11-14 22:03:55 UTC) #19
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 1 month ago (2016-11-15 00:53:41 UTC) #20
commit-bot: I haz the power
4 years, 1 month ago (2016-11-15 01:04:44 UTC) #22
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/d9f152f1d2e35a35a726a3891c00a764de144b39
Cr-Commit-Position: refs/heads/master@{#432035}

Powered by Google App Engine
This is Rietveld 408576698