The new media session service is responsible for controlling media playback across the entire system (within a WebContents, ARC++ app, etc). We should add support for delegating media keys on CrOS devices to the service (instead of the browser).
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/96f9f8b819eadeb1af30649fb89b11ba6eaca250 commit 96f9f8b819eadeb1af30649fb89b11ba6eaca250 Author: Becca Hughes <beccahughes@chromium.org> Date: Wed Oct 17 18:33:33 2018 [Media Controller] Make system if feature is enabled If the "MediaSessionAccelerators" feature is enabled then media keys should behave as system keys. This means they will be handled in ash unless a Chrome app is overridding the behaviour. BUG=894255 Change-Id: I00d8c5a0d8e2c9f73531408f30ddeb56424ad03e Reviewed-on: https://chromium-review.googlesource.com/c/1274885 Commit-Queue: Becca Hughes <beccahughes@chromium.org> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org> Reviewed-by: James Cook <jamescook@chromium.org> Cr-Commit-Position: refs/heads/master@{#600488} [modify] https://crrev.com/96f9f8b819eadeb1af30649fb89b11ba6eaca250/ash/accelerators/accelerator_controller_unittest.cc [modify] https://crrev.com/96f9f8b819eadeb1af30649fb89b11ba6eaca250/ash/accelerators/pre_target_accelerator_handler.cc [modify] https://crrev.com/96f9f8b819eadeb1af30649fb89b11ba6eaca250/ash/public/cpp/ash_features.cc [modify] https://crrev.com/96f9f8b819eadeb1af30649fb89b11ba6eaca250/ash/public/cpp/ash_features.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3d63a91d39a12587685561189df06d6181575bfe commit 3d63a91d39a12587685561189df06d6181575bfe Author: Becca Hughes <beccahughes@chromium.org> Date: Wed Oct 17 19:30:39 2018 [Media Controller] Add ash flag to chrome flags Add the flag for media session media key handling in ash to chrome://flags. BUG=894255 Change-Id: I7bdeea6312629d284e7d7ec6441a1d6948063ccf Reviewed-on: https://chromium-review.googlesource.com/c/1286972 Reviewed-by: Tommy Steimel <steimel@chromium.org> Commit-Queue: Becca Hughes <beccahughes@chromium.org> Cr-Commit-Position: refs/heads/master@{#600517} [modify] https://crrev.com/3d63a91d39a12587685561189df06d6181575bfe/chrome/browser/about_flags.cc [modify] https://crrev.com/3d63a91d39a12587685561189df06d6181575bfe/chrome/browser/flag_descriptions.cc [modify] https://crrev.com/3d63a91d39a12587685561189df06d6181575bfe/chrome/browser/flag_descriptions.h [modify] https://crrev.com/3d63a91d39a12587685561189df06d6181575bfe/tools/metrics/histograms/enums.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/253f1bbf367b8e11db97bf9743a502b4a3ee1002 commit 253f1bbf367b8e11db97bf9743a502b4a3ee1002 Author: Becca Hughes <beccahughes@chromium.org> Date: Thu Oct 18 18:38:31 2018 [Media Controller] Forward play pause key to service If the media session feature is enabled then use the media session service to control playback when the play/pause media key is pressed. BUG=894255 Change-Id: I5c34b24536456e4fcacabed6f4a8d2aa9f5d0ec5 Reviewed-on: https://chromium-review.googlesource.com/c/1278147 Commit-Queue: Becca Hughes <beccahughes@chromium.org> Reviewed-by: James Cook <jamescook@chromium.org> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org> Cr-Commit-Position: refs/heads/master@{#600839} [modify] https://crrev.com/253f1bbf367b8e11db97bf9743a502b4a3ee1002/ash/BUILD.gn [modify] https://crrev.com/253f1bbf367b8e11db97bf9743a502b4a3ee1002/ash/DEPS [modify] https://crrev.com/253f1bbf367b8e11db97bf9743a502b4a3ee1002/ash/accelerators/accelerator_controller_unittest.cc [modify] https://crrev.com/253f1bbf367b8e11db97bf9743a502b4a3ee1002/ash/media_controller.cc [modify] https://crrev.com/253f1bbf367b8e11db97bf9743a502b4a3ee1002/ash/media_controller.h [modify] https://crrev.com/253f1bbf367b8e11db97bf9743a502b4a3ee1002/ash/shell.cc [modify] https://crrev.com/253f1bbf367b8e11db97bf9743a502b4a3ee1002/services/media_session/public/cpp/test/BUILD.gn [add] https://crrev.com/253f1bbf367b8e11db97bf9743a502b4a3ee1002/services/media_session/public/cpp/test/test_media_controller.cc [add] https://crrev.com/253f1bbf367b8e11db97bf9743a502b4a3ee1002/services/media_session/public/cpp/test/test_media_controller.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/43939c76fecc202efc74483e4f0a126651f9ba0c commit 43939c76fecc202efc74483e4f0a126651f9ba0c Author: Becca Hughes <beccahughes@chromium.org> Date: Mon Oct 29 18:14:06 2018 [Media Controller] Forward next and prev to service If the media session feature is enabled then use the media session service to control playback when the next/previous track media keys are pressed. BUG=894255 Change-Id: I0bd99bad14ce9973d10f2c4567dd487bda0ac436 Reviewed-on: https://chromium-review.googlesource.com/c/1289149 Commit-Queue: Becca Hughes <beccahughes@chromium.org> Reviewed-by: James Cook <jamescook@chromium.org> Cr-Commit-Position: refs/heads/master@{#603566} [modify] https://crrev.com/43939c76fecc202efc74483e4f0a126651f9ba0c/ash/accelerators/accelerator_controller_unittest.cc [modify] https://crrev.com/43939c76fecc202efc74483e4f0a126651f9ba0c/ash/media_controller.cc [modify] https://crrev.com/43939c76fecc202efc74483e4f0a126651f9ba0c/ash/media_controller.h [modify] https://crrev.com/43939c76fecc202efc74483e4f0a126651f9ba0c/services/media_session/public/cpp/test/test_media_controller.cc [modify] https://crrev.com/43939c76fecc202efc74483e4f0a126651f9ba0c/services/media_session/public/cpp/test/test_media_controller.h
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/7bffebdbf3fb4fe58a2571b4243a5cabf6820c45 commit 7bffebdbf3fb4fe58a2571b4243a5cabf6820c45 Author: Becca Hughes <beccahughes@chromium.org> Date: Fri Nov 30 03:31:21 2018 tast tests: Add additional media session tests Add additional media session tast tests to test the different audio focus types. Also breaks out the shared logic from the previous arcapp.MediaSession test. BUG=chromium:894255 TEST=Run tast Change-Id: I8fee0d2c8ef1f9a150d8c9a1a2ba4a56b0e3fcb4 Reviewed-on: https://chromium-review.googlesource.com/1331650 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Becca Hughes <beccahughes@chromium.org> Reviewed-by: Dan Erat <derat@chromium.org> [add] https://crrev.com/7bffebdbf3fb4fe58a2571b4243a5cabf6820c45/src/chromiumos/tast/local/bundles/cros/arcapp/media_session_gain.go [add] https://crrev.com/7bffebdbf3fb4fe58a2571b4243a5cabf6820c45/src/chromiumos/tast/local/bundles/cros/arcapp/media_session_gain_transient_duck.go [add] https://crrev.com/7bffebdbf3fb4fe58a2571b4243a5cabf6820c45/src/chromiumos/tast/local/bundles/cros/arcapp/mediasession/mediasession.go [add] https://crrev.com/7bffebdbf3fb4fe58a2571b4243a5cabf6820c45/src/chromiumos/tast/local/bundles/cros/arcapp/media_session_gain_transient.go [delete] https://crrev.com/9040fcd664266f8736d5973769dc9d618ca4c17e/src/chromiumos/tast/local/bundles/cros/arcapp/media_session.go
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bbfd9929bb4115f07015533f650d6c737fbd5c49 commit bbfd9929bb4115f07015533f650d6c737fbd5c49 Author: Becca Hughes <beccahughes@chromium.org> Date: Fri Jan 11 17:19:51 2019 [Media Session] Trigger action on play / pause At the moment on Android we trigger the kPlay or kPause actions if they are registered. This moves that logic a layer down to C++ so it will work for keyboard controls too. BUG=894255 Change-Id: I0eae3ac51b7d772643ab2a56091e3f0ddb6b2325 Reviewed-on: https://chromium-review.googlesource.com/c/1404178 Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Commit-Queue: Becca Hughes <beccahughes@chromium.org> Cr-Commit-Position: refs/heads/master@{#622044} [modify] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java [modify] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/content/browser/media/session/media_session_impl.cc [modify] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/content/browser/media/session/media_session_impl_browsertest.cc [modify] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/content/browser/media/session/media_session_impl_service_routing_unittest.cc [modify] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/content/browser/media/session/media_session_impl_uma_unittest.cc [modify] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/content/browser/media/session/media_session_impl_unittest.cc [modify] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/content/browser/media/session/media_session_service_impl.cc [modify] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/content/browser/media/session/media_session_service_impl.h [add] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/content/browser/media/session/mock_media_session_service_impl.cc [add] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/content/browser/media/session/mock_media_session_service_impl.h [modify] https://crrev.com/bbfd9929bb4115f07015533f650d6c737fbd5c49/content/test/BUILD.gn
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5 commit 446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5 Author: Becca Hughes <beccahughes@chromium.org> Date: Tue Jan 15 04:51:17 2019 [Media Session] Use actions for ash::MediaController This changes the behaviour of ash::MediaController to only use the media session service if we have a media session that supports any key controlled action. This means if we have either no media session or a session that cannot be controlled we will fallback to the old codepath. BUG=894255 Change-Id: I3e8105616a6a6c9cf5af5fc9c5dec3e596c2930d Reviewed-on: https://chromium-review.googlesource.com/c/1407431 Commit-Queue: Becca Hughes <beccahughes@chromium.org> Reviewed-by: Mitsuru Oshima <oshima@chromium.org> Cr-Commit-Position: refs/heads/master@{#622735} [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/BUILD.gn [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/accelerators/accelerator_controller.cc [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/accelerators/accelerator_controller_unittest.cc [rename] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/media/media_controller.cc [rename] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/media/media_controller.h [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/mojo_interface_factory.cc [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/multi_user/multi_user_window_manager.cc [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/shell.cc [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/system/power/power_button_controller_unittest.cc [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/system/power/power_button_display_controller.cc [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/ash/system/unified/user_chooser_view.h [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/services/media_session/public/cpp/test/test_media_controller.cc [modify] https://crrev.com/446aaccfcc8d4e11c5d00ae3453a167ab2dad3a5/services/media_session/public/cpp/test/test_media_controller.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d500752e6903714cc8a9b938af49f608fc048c37 commit d500752e6903714cc8a9b938af49f608fc048c37 Author: Becca Hughes <beccahughes@chromium.org> Date: Wed Jan 16 23:08:44 2019 [Media Session] Expose default actions on observer If a content::MediaSession can handle a default action (e.g. play / pause) then it should notify the observer that that action is available. BUG=894255 Change-Id: Ibe4fca96ccc74a7e10ea39e2972557c78d9653af Reviewed-on: https://chromium-review.googlesource.com/c/1407927 Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Commit-Queue: Becca Hughes <beccahughes@chromium.org> Cr-Commit-Position: refs/heads/master@{#623429} [modify] https://crrev.com/d500752e6903714cc8a9b938af49f608fc048c37/content/browser/media/session/media_session_impl.cc [modify] https://crrev.com/d500752e6903714cc8a9b938af49f608fc048c37/content/browser/media/session/media_session_impl.h [modify] https://crrev.com/d500752e6903714cc8a9b938af49f608fc048c37/content/browser/media/session/media_session_impl_browsertest.cc [modify] https://crrev.com/d500752e6903714cc8a9b938af49f608fc048c37/content/browser/media/session/media_session_impl_service_routing_unittest.cc [modify] https://crrev.com/d500752e6903714cc8a9b938af49f608fc048c37/content/browser/media/session/media_session_impl_unittest.cc [modify] https://crrev.com/d500752e6903714cc8a9b938af49f608fc048c37/content/browser/media/session/media_session_service_impl_browsertest.cc [modify] https://crrev.com/d500752e6903714cc8a9b938af49f608fc048c37/services/media_session/public/cpp/test/mock_media_session.cc [modify] https://crrev.com/d500752e6903714cc8a9b938af49f608fc048c37/services/media_session/public/cpp/test/mock_media_session.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea commit 2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea Author: Becca Hughes <beccahughes@chromium.org> Date: Fri Jan 18 19:38:34 2019 Use HardwareMediaKeyHandling flag for Chrome OS We have a hardware media key handling feature flag for harward media keys on non-Chrome OS platforms. We should replace the ash feature with that one for consistency. BUG=894255 Change-Id: Ia0490a05a1f2cf582ce32adad4a431d745d7727e Reviewed-on: https://chromium-review.googlesource.com/c/1418900 Reviewed-by: Tommy Steimel <steimel@chromium.org> Reviewed-by: Mitsuru Oshima <oshima@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Becca Hughes <beccahughes@chromium.org> Cr-Commit-Position: refs/heads/master@{#624237} [modify] https://crrev.com/2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea/ash/accelerators/accelerator_controller_unittest.cc [modify] https://crrev.com/2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea/ash/accelerators/pre_target_accelerator_handler.cc [modify] https://crrev.com/2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea/ash/media/media_controller.cc [modify] https://crrev.com/2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea/ash/public/cpp/ash_features.cc [modify] https://crrev.com/2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea/ash/public/cpp/ash_features.h [modify] https://crrev.com/2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea/chrome/browser/about_flags.cc [modify] https://crrev.com/2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea/chrome/browser/flag-metadata.json [modify] https://crrev.com/2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea/chrome/browser/flag_descriptions.cc [modify] https://crrev.com/2af44f49a8c3076c6ddcda7edb0a721b6cc2f9ea/chrome/browser/flag_descriptions.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/337ecd5261cbbb5d6d9113a516b863e6e1f6a0b3 commit 337ecd5261cbbb5d6d9113a516b863e6e1f6a0b3 Author: Becca Hughes <beccahughes@chromium.org> Date: Tue Jan 22 19:23:19 2019 [Media Session] Fix actions not available Fixes when default actions are not available when the routed service is nullptr. BUG=894255 Change-Id: I2d396ffbf5eeb46b18b30d489ee43533d0cb2f1f Reviewed-on: https://chromium-review.googlesource.com/c/1418510 Commit-Queue: Becca Hughes <beccahughes@chromium.org> Reviewed-by: Chrome Cunningham <chcunningham@chromium.org> Cr-Commit-Position: refs/heads/master@{#624868} [modify] https://crrev.com/337ecd5261cbbb5d6d9113a516b863e6e1f6a0b3/content/browser/media/session/media_session_impl.cc [modify] https://crrev.com/337ecd5261cbbb5d6d9113a516b863e6e1f6a0b3/content/browser/media/session/media_session_impl.h [modify] https://crrev.com/337ecd5261cbbb5d6d9113a516b863e6e1f6a0b3/content/browser/media/session/media_session_impl_service_routing_unittest.cc
Comment 1 Deleted