From 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 6 Oct 2020 12:48:11 +0200 Subject: BASELINE: Update Chromium to 84.0.4147.141 Change-Id: Ib85eb4cfa1cbe2b2b81e5022c8cad5c493969535 Reviewed-by: Allan Sandfeld Jensen --- chromium/chromecast/BUILD.gn | 16 ++++++--- chromium/chromecast/android/BUILD.gn | 2 +- chromium/chromecast/app/BUILD.gn | 2 +- chromium/chromecast/browser/BUILD.gn | 21 ++++++++--- chromium/chromecast/browser/android/BUILD.gn | 11 ++++-- .../chromecast/browser/webview/client/BUILD.gn | 2 ++ chromium/chromecast/build/BUILD.gn | 1 + chromium/chromecast/common/extensions_api/BUILD.gn | 1 + chromium/chromecast/common/mojom/BUILD.gn | 6 +--- .../common/mojom/media_playback_options.mojom | 21 ----------- chromium/chromecast/device/bluetooth/le/BUILD.gn | 41 +++++++++++++++------- chromium/chromecast/media/BUILD.gn | 1 + chromium/chromecast/media/api/BUILD.gn | 23 ++++++++++++ chromium/chromecast/media/audio/BUILD.gn | 26 +++++++++++--- chromium/chromecast/media/cma/BUILD.gn | 3 +- .../chromecast/media/cma/backend/cplay/BUILD.gn | 7 ++-- .../chromecast/media/cma/backend/desktop/BUILD.gn | 3 +- .../chromecast/media/cma/backend/mixer/BUILD.gn | 1 + .../chromecast/media/cma/backend/video/BUILD.gn | 12 ++++++- chromium/chromecast/metrics/BUILD.gn | 35 +++++++++++++++--- chromium/chromecast/renderer/BUILD.gn | 3 +- chromium/chromecast/ui/BUILD.gn | 32 +++++++++++++++++ chromium/chromecast/ui/display_settings/BUILD.gn | 35 ++++++++++++++++++ chromium/chromecast/ui/mojom/BUILD.gn | 5 +++ .../chromecast/ui/mojom/display_settings.mojom | 41 ++++++++++++++++++++++ 25 files changed, 278 insertions(+), 73 deletions(-) delete mode 100644 chromium/chromecast/common/mojom/media_playback_options.mojom create mode 100644 chromium/chromecast/ui/display_settings/BUILD.gn create mode 100644 chromium/chromecast/ui/mojom/display_settings.mojom (limited to 'chromium/chromecast') diff --git a/chromium/chromecast/BUILD.gn b/chromium/chromecast/BUILD.gn index fcfb14fb110..f3a49cb4688 100644 --- a/chromium/chromecast/BUILD.gn +++ b/chromium/chromecast/BUILD.gn @@ -77,6 +77,7 @@ cast_test_group("cast_tests") { "//chromecast/crypto:cast_crypto_unittests", "//chromecast/device/bluetooth:cast_bluetooth_unittests", "//chromecast/media:cast_media_unittests", + "//chromecast/metrics:cast_metrics_unittest", "//chromecast/net:cast_net_unittests", "//chromecast/system/reboot:cast_reboot_unittests", "//content/test:content_unittests", @@ -128,7 +129,11 @@ cast_test_group("cast_tests") { test_name = "cast_audio_backend_unittests" # --test-launcher-jobs=1 => so mixer service receiver can bind. - args = [ "--test-launcher-jobs=1" ] + args = [ + "--test-launcher-jobs=1", + "--mixer-service-endpoint=/tmp/cast_audio_backend_unittest-mixer", + "--mixer-service-port=12855", + ] } filters += [ cast_audio_backend_unittests_filter ] } @@ -165,7 +170,7 @@ cast_test_group("cast_tests") { "--no-sandbox", "--enable-local-file-accesses", "--test-launcher-jobs=1", - "--enable-hardware-overlays=\"\"", + "--enable-hardware-overlays=", ] gtest_excludes = [] @@ -407,7 +412,10 @@ cast_test_group_list("cast_test_lists") { test_groups = [ ":cast_tests" ] if (chromecast_branding != "public") { - test_groups += [ "//chromecast/internal:internal_cast_tests" ] + test_groups += [ + "//chromecast/internal:internal_cast_tests", + "//chromecast/internal/iot_services:iot_tests", + ] } } @@ -481,7 +489,7 @@ cast_executable("cast_shell") { ":cast_shell_lib", ":chromecast_locales_pak", "//chromecast/app", - "//content/public/app:both", + "//content/public/app", ] } diff --git a/chromium/chromecast/android/BUILD.gn b/chromium/chromecast/android/BUILD.gn index 6e3ed73eac6..ef492b8f006 100644 --- a/chromium/chromecast/android/BUILD.gn +++ b/chromium/chromecast/android/BUILD.gn @@ -26,7 +26,7 @@ cast_shared_library("libcast_shell_android") { "//chromecast/media/cma/backend/android:cast_media_android", "//components/crash/android:crash_android", "//components/minidump_uploader", - "//content/public/app:both", + "//content/public/app", "//content/public/browser", "//skia", ] diff --git a/chromium/chromecast/app/BUILD.gn b/chromium/chromecast/app/BUILD.gn index 36be37ddc59..17cf2a2a1b1 100644 --- a/chromium/chromecast/app/BUILD.gn +++ b/chromium/chromecast/app/BUILD.gn @@ -24,7 +24,7 @@ cast_source_set("app") { "//chromecast/renderer", "//chromecast/utility", "//components/crash/core/common:crash_key", - "//content/public/app:both", + "//content/public/app", "//content/public/browser", "//content/public/common", "//ui/base", diff --git a/chromium/chromecast/browser/BUILD.gn b/chromium/chromecast/browser/BUILD.gn index 73763c7a6d8..da6347ebb27 100644 --- a/chromium/chromecast/browser/BUILD.gn +++ b/chromium/chromecast/browser/BUILD.gn @@ -149,6 +149,7 @@ cast_source_set("browser") { ":public", "//chromecast/browser/metrics", "//chromecast/metrics", + "//components/media_control/mojom", ] deps = [ @@ -183,6 +184,7 @@ cast_source_set("browser") { "//chromecast/service", "//components/cdm/browser", "//components/download/public/common:public", + "//components/media_control/browser", "//components/metrics", "//components/metrics:gpu", "//components/metrics:net", @@ -206,10 +208,12 @@ cast_source_set("browser") { "//gpu", "//ipc", "//media", + "//media/mojo/services", "//net", "//services/media_session/public/mojom", "//services/network/public/mojom", "//services/service_manager/public/cpp", + "//third_party/blink/public/common:headers", "//ui/base", "//ui/compositor", "//ui/display", @@ -289,7 +293,7 @@ cast_source_set("browser") { # TODO(crbug.com/933142): Fuchsia needs its own methods to bridge with heap # profiling service deps += [ - "//components/heap_profiling", + "//components/heap_profiling/multi_process", "//components/services/heap_profiling", "//components/services/heap_profiling/public/cpp", "//components/services/heap_profiling/public/mojom", @@ -300,10 +304,6 @@ cast_source_set("browser") { deps += [ "//ui/ozone" ] } - if (enable_mojo_media) { - deps += [ "//media/mojo/services" ] - } - if (enable_external_mojo_services) { deps += [ "//chromecast/external_mojo/broker_service" ] } @@ -334,6 +334,8 @@ cast_source_set("browser") { "extensions/api/i18n/i18n_api.h", "extensions/api/identity/identity_api.cc", "extensions/api/identity/identity_api.h", + "extensions/api/login_state/login_state.cc", + "extensions/api/login_state/login_state.h", "extensions/api/notifications/notifications_api.cc", "extensions/api/notifications/notifications_api.h", "extensions/api/settings_private/settings_private_api.cc", @@ -360,6 +362,8 @@ cast_source_set("browser") { "extensions/cast_extensions_browser_api_provider.h", "extensions/cast_extensions_browser_client.cc", "extensions/cast_extensions_browser_client.h", + "extensions/cast_kiosk_delegate.cc", + "extensions/cast_kiosk_delegate.h", "extensions/cast_prefs.cc", "extensions/cast_prefs.h", "extensions/stub_storage_monitor.cc", @@ -487,6 +491,10 @@ cast_source_set("test_support") { sources = [ "test/cast_browser_test.cc", "test/cast_browser_test.h", + "test/mock_cast_content_window_delegate.cc", + "test/mock_cast_content_window_delegate.h", + "test/mock_cast_web_view.cc", + "test/mock_cast_web_view.h", ] public_deps = [ @@ -500,6 +508,7 @@ cast_source_set("test_support") { "//components/prefs:test_support", "//content/public/browser", "//content/public/common", + "//testing/gmock", "//testing/gtest", ] } @@ -513,6 +522,7 @@ cast_source_set("browsertests") { "renderer_prelauncher_test.cc", "test/cast_features_browsertest.cc", "test/cast_navigation_browsertest.cc", + "webview/webview_browsertest.cc", ] defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] @@ -524,6 +534,7 @@ cast_source_set("browsertests") { "//chromecast/base", "//chromecast/base:chromecast_switches", "//chromecast/base/metrics", + "//components/keyed_service/content", "//components/prefs", "//content/public/browser", "//content/test:test_support", diff --git a/chromium/chromecast/browser/android/BUILD.gn b/chromium/chromecast/browser/android/BUILD.gn index fc5132236b4..67d171d0447 100644 --- a/chromium/chromecast/browser/android/BUILD.gn +++ b/chromium/chromecast/browser/android/BUILD.gn @@ -125,6 +125,12 @@ generate_product_config_srcjar("chromecast_product_config") { java_package = "org.chromium.chromecast.shell" } +android_library("resume_intents_java") { + java_src_dir = "//chromecast/browser/android/apk/src" + sources = [ "$java_src_dir/org/chromium/chromecast/shell/ResumeIntents.java" ] + deps = [ "//chromecast/base:base_java" ] +} + android_library("cast_shell_java") { java_src_dir = "//chromecast/browser/android/apk/src" sources = [ @@ -150,11 +156,9 @@ android_library("cast_shell_java") { "$java_src_dir/org/chromium/chromecast/shell/ElidedLogcatProvider.java", "$java_src_dir/org/chromium/chromecast/shell/ExternalServiceDeviceLogcatProvider.java", "$java_src_dir/org/chromium/chromecast/shell/LogcatElision.java", + "$java_src_dir/org/chromium/chromecast/shell/WebContentsRegistry.java", ] - android_manifest_for_lint = cast_shell_android_manifest - min_sdk_version = 21 - srcjar_deps = [ ":cast_shell_build_config_gen", ":chromecast_product_config", @@ -170,6 +174,7 @@ android_library("cast_shell_java") { ":cast_shell_android_resources", ":cast_shell_manifest", ":reactive_android_java", + ":resume_intents_java", "//base:base_java", "//base:jni_java", "//chromecast/base:base_java", diff --git a/chromium/chromecast/browser/webview/client/BUILD.gn b/chromium/chromecast/browser/webview/client/BUILD.gn index 598ce320e07..a62101532d7 100644 --- a/chromium/chromecast/browser/webview/client/BUILD.gn +++ b/chromium/chromecast/browser/webview/client/BUILD.gn @@ -15,6 +15,8 @@ executable("wayland_webview_client") { "//components/exo/wayland:client_support", "//skia", "//third_party/wayland:wayland_client", + "//ui/events:event_constants", + "//ui/events/types:headers", "//ui/gl", ] } diff --git a/chromium/chromecast/build/BUILD.gn b/chromium/chromecast/build/BUILD.gn index b696a9f0d7d..7483874626d 100644 --- a/chromium/chromecast/build/BUILD.gn +++ b/chromium/chromecast/build/BUILD.gn @@ -15,6 +15,7 @@ if (is_android) { } group("archive") { + testonly = true if (chromecast_branding == "internal") { deps = [ "//chromecast/internal/build:archive" ] } else if (is_android) { diff --git a/chromium/chromecast/common/extensions_api/BUILD.gn b/chromium/chromecast/common/extensions_api/BUILD.gn index 50993ea9c4a..599ac7df0e8 100644 --- a/chromium/chromecast/common/extensions_api/BUILD.gn +++ b/chromium/chromecast/common/extensions_api/BUILD.gn @@ -21,6 +21,7 @@ schema_sources = [ "history.json", "i18n.json", "identity.idl", + "login_state.idl", "notifications.idl", "settings_private.idl", "tabs.json", diff --git a/chromium/chromecast/common/mojom/BUILD.gn b/chromium/chromecast/common/mojom/BUILD.gn index f2a4e10436b..abbe2cb91fb 100644 --- a/chromium/chromecast/common/mojom/BUILD.gn +++ b/chromium/chromecast/common/mojom/BUILD.gn @@ -12,7 +12,6 @@ mojom("mojom") { "feature_manager.mojom", "js_channel.mojom", "media_caps.mojom", - "media_playback_options.mojom", "memory_pressure.mojom", "multiroom.mojom", "on_load_script_injector.mojom", @@ -20,8 +19,5 @@ mojom("mojom") { "service_connector.mojom", ] - public_deps = [ - "//content/public/common:renderer_type", - "//mojo/public/mojom/base", - ] + public_deps = [ "//mojo/public/mojom/base" ] } diff --git a/chromium/chromecast/common/mojom/media_playback_options.mojom b/chromium/chromecast/common/mojom/media_playback_options.mojom deleted file mode 100644 index 8f94e2dbbbe..00000000000 --- a/chromium/chromecast/common/mojom/media_playback_options.mojom +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -module chromecast.shell.mojom; - -import "content/public/common/media_playback_renderer_type.mojom"; - -// Receives messages from browser process to control media playback options -// (block loading, background playback) for a specific RenderFrame. -// Implemented by a RenderFrameObserver. -interface MediaPlaybackOptions { - // Set true to enable background suspend - SetMediaLoadingBlocked(bool blocked); - - // Set true to allow video playback to be played in the background - SetBackgroundVideoPlaybackEnabled(bool enabled); - - // Set the renderer type that will be used in WebMediaPlayerImpl - SetRendererType(content.mojom.RendererType type); -}; diff --git a/chromium/chromecast/device/bluetooth/le/BUILD.gn b/chromium/chromecast/device/bluetooth/le/BUILD.gn index 6ea1081d61a..a1f16be7065 100644 --- a/chromium/chromecast/device/bluetooth/le/BUILD.gn +++ b/chromium/chromecast/device/bluetooth/le/BUILD.gn @@ -9,27 +9,16 @@ cast_source_set("le") { sources = [ "ble_notification_logger.cc", "ble_notification_logger.h", + "ble_types.h", "gatt_client_manager.h", - "gatt_client_manager_impl.cc", - "gatt_client_manager_impl.h", "le_scan_manager.h", - "le_scan_manager_impl.cc", - "le_scan_manager_impl.h", "le_scan_result.cc", "le_scan_result.h", "remote_characteristic.h", - "remote_characteristic_impl.cc", - "remote_characteristic_impl.h", "remote_descriptor.cc", "remote_descriptor.h", - "remote_descriptor_impl.cc", - "remote_descriptor_impl.h", "remote_device.h", - "remote_device_impl.cc", - "remote_device_impl.h", "remote_service.h", - "remote_service_impl.cc", - "remote_service_impl.h", "scan_filter.cc", "scan_filter.h", ] @@ -40,12 +29,37 @@ cast_source_set("le") { "//base", "//chromecast/base", "//chromecast/device/bluetooth:util", - "//chromecast/device/bluetooth/shlib", "//chromecast/public", "//third_party/re2", ] } +cast_source_set("le_impl") { + sources = [ + "gatt_client_manager_impl.cc", + "gatt_client_manager_impl.h", + "le_scan_manager_impl.cc", + "le_scan_manager_impl.h", + "remote_characteristic_impl.cc", + "remote_characteristic_impl.h", + "remote_descriptor_impl.cc", + "remote_descriptor_impl.h", + "remote_device_impl.cc", + "remote_device_impl.h", + "remote_service_impl.cc", + "remote_service_impl.h", + ] + + deps = [ + ":le", + "//base", + "//chromecast/base", + "//chromecast/device/bluetooth:util", + "//chromecast/device/bluetooth/shlib", + "//chromecast/public", + ] +} + cast_source_set("test_support") { testonly = true @@ -83,6 +97,7 @@ cast_source_set("unittests") { ] deps = [ ":le", + ":le_impl", ":test_support", "//base", "//base/test:test_support", diff --git a/chromium/chromecast/media/BUILD.gn b/chromium/chromecast/media/BUILD.gn index ef469d7e311..3cd39a12b5d 100644 --- a/chromium/chromecast/media/BUILD.gn +++ b/chromium/chromecast/media/BUILD.gn @@ -77,6 +77,7 @@ test("cast_media_unittests") { "//chromecast/base", "//chromecast/base/metrics:test_support", "//chromecast/common/mojom", + "//chromecast/media/api:test_support", "//chromecast/media/audio:unittests", "//chromecast/media/audio/capture_service:unittests", "//chromecast/media/base:monotonic_clock", diff --git a/chromium/chromecast/media/api/BUILD.gn b/chromium/chromecast/media/api/BUILD.gn index 6de7b4f5485..81369a62cbc 100644 --- a/chromium/chromecast/media/api/BUILD.gn +++ b/chromium/chromecast/media/api/BUILD.gn @@ -7,10 +7,13 @@ import("//chromecast/chromecast.gni") cast_source_set("api") { sources = [ "cast_audio_decoder.h", + "cast_audio_resampler.h", + "cast_sounds_manager.h", "cma_backend.h", "cma_backend_factory.h", "decoder_buffer_base.h", "monotonic_clock.h", + "sound_player.h", ] public_deps = [ @@ -20,3 +23,23 @@ cast_source_set("api") { assert_no_deps = [ "//media" ] } + +cast_source_set("test_support") { + testonly = true + sources = [ + "test/mock_cast_sounds_manager.cc", + "test/mock_cast_sounds_manager.h", + "test/mock_cma_backend.cc", + "test/mock_cma_backend.h", + "test/mock_sound_player.cc", + "test/mock_sound_player.h", + ] + + deps = [ + "//chromecast/media/api", + "//testing/gmock", + "//testing/gtest", + ] + + assert_no_deps = [ "//media" ] +} diff --git a/chromium/chromecast/media/audio/BUILD.gn b/chromium/chromecast/media/audio/BUILD.gn index a2d9f77eb08..1e8b13a84d8 100644 --- a/chromium/chromecast/media/audio/BUILD.gn +++ b/chromium/chromecast/media/audio/BUILD.gn @@ -22,6 +22,10 @@ cast_source_set("audio_io_thread") { deps = [ "//base" ] } +cast_source_set("wav_header") { + sources = [ "wav_header.h" ] +} + cast_source_set("processing") { sources = [ "audio_clock_simulator.cc", @@ -29,6 +33,20 @@ cast_source_set("processing") { "audio_fader.cc", "audio_fader.h", "audio_provider.h", + "cast_audio_bus.cc", + "cast_audio_bus.h", + ] + + deps = [ "//base" ] + + # Use fastest possible float math. + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_speed" ] + cflags = [ "-ffast-math" ] +} + +cast_source_set("interleaved_channel_mixer") { + sources = [ "interleaved_channel_mixer.cc", "interleaved_channel_mixer.h", ] @@ -37,11 +55,6 @@ cast_source_set("processing") { "//base", "//media", ] - - # Use fastest possible float math. - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_speed" ] - cflags = [ "-ffast-math" ] } cast_source_set("audio") { @@ -54,6 +67,7 @@ cast_source_set("audio") { "cast_audio_mixer.h", "cast_audio_output_stream.cc", "cast_audio_output_stream.h", + "cast_audio_resampler_impl.cc", "cma_audio_output_stream.cc", "cma_audio_output_stream.h", ] @@ -63,6 +77,7 @@ cast_source_set("audio") { "//base", "//chromecast/base", "//chromecast/common/mojom", + "//chromecast/media/api", "//chromecast/media/audio/capture_service:receiver", "//chromecast/media/audio/mixer_service:common", "//chromecast/media/audio/mixer_service:output_stream_connection", @@ -164,6 +179,7 @@ cast_source_set("unittests") { ] deps = [ + ":interleaved_channel_mixer", ":processing", "//base", "//media", diff --git a/chromium/chromecast/media/cma/BUILD.gn b/chromium/chromecast/media/cma/BUILD.gn index 0d2bcb2e784..0a267866cd2 100644 --- a/chromium/chromecast/media/cma/BUILD.gn +++ b/chromium/chromecast/media/cma/BUILD.gn @@ -21,8 +21,6 @@ cast_source_set("test_support") { "test/frame_generator_for_test.h", "test/frame_segmenter_for_test.cc", "test/frame_segmenter_for_test.h", - "test/mock_cma_backend.cc", - "test/mock_cma_backend.h", "test/mock_cma_backend_factory.cc", "test/mock_cma_backend_factory.h", "test/mock_frame_consumer.cc", @@ -72,6 +70,7 @@ cast_source_set("unittests") { "//chromecast/media", "//chromecast/media:libcast_media", "//chromecast/media/api", + "//chromecast/media/api:test_support", "//media", "//testing/gmock", "//testing/gtest", diff --git a/chromium/chromecast/media/cma/backend/cplay/BUILD.gn b/chromium/chromecast/media/cma/backend/cplay/BUILD.gn index 0d9a9380a60..a979a660d30 100644 --- a/chromium/chromecast/media/cma/backend/cplay/BUILD.gn +++ b/chromium/chromecast/media/cma/backend/cplay/BUILD.gn @@ -3,12 +3,11 @@ # found in the LICENSE file. executable("cplay") { - sources = [ - "cplay.cc", - "wav_header.h", - ] + sources = [ "cplay.cc" ] + deps = [ "//base", + "//chromecast/media/audio:wav_header", "//chromecast/media/cma/backend:cast_audio_json", "//chromecast/media/cma/backend:public", "//chromecast/media/cma/backend:volume_map", diff --git a/chromium/chromecast/media/cma/backend/desktop/BUILD.gn b/chromium/chromecast/media/cma/backend/desktop/BUILD.gn index e1b2a73a309..c4751417760 100644 --- a/chromium/chromecast/media/cma/backend/desktop/BUILD.gn +++ b/chromium/chromecast/media/cma/backend/desktop/BUILD.gn @@ -25,10 +25,11 @@ cast_source_set("desktop") { "//media", ] if (enable_video_with_mixed_audio) { + sources += [ "desktop_system_volume_control.cc" ] deps += [ "//chromecast/media/cma/backend:for_mixer_audio", "//chromecast/media/cma/backend:null_video", - "//chromecast/media/cma/backend/alsa:volume_control", + "//chromecast/media/cma/backend:public", "//chromecast/media/cma/backend/video:av_sync_video", ] } else { diff --git a/chromium/chromecast/media/cma/backend/mixer/BUILD.gn b/chromium/chromecast/media/cma/backend/mixer/BUILD.gn index 02c3ed7e746..c3870f88628 100644 --- a/chromium/chromecast/media/cma/backend/mixer/BUILD.gn +++ b/chromium/chromecast/media/cma/backend/mixer/BUILD.gn @@ -72,6 +72,7 @@ cast_source_set("mixer") { "//chromecast/base:chromecast_switches", "//chromecast/base:thread_health_checker", "//chromecast/media/audio:audio_io_thread", + "//chromecast/media/audio:interleaved_channel_mixer", "//chromecast/media/audio:libcast_external_audio_pipeline_1.0", "//chromecast/media/audio:processing", "//chromecast/media/audio/mixer_service:common", diff --git a/chromium/chromecast/media/cma/backend/video/BUILD.gn b/chromium/chromecast/media/cma/backend/video/BUILD.gn index 1981bd67088..9c52c155194 100644 --- a/chromium/chromecast/media/cma/backend/video/BUILD.gn +++ b/chromium/chromecast/media/cma/backend/video/BUILD.gn @@ -6,6 +6,10 @@ import("//build/config/chromecast_build.gni") import("//chromecast/chromecast.gni") import("//media/media_options.gni") +declare_args() { + cast_static_videodecoderformixer_lib_target = "" +} + cast_source_set("av_sync_video") { sources = [ "av_sync_video.cc", @@ -49,9 +53,15 @@ cast_source_set("libcast_media_1.0_avsync") { "//media", ] + if (cast_static_videodecoderformixer_lib_target != "") { + deps += [ "$cast_static_videodecoderformixer_lib_target" ] + } + if (use_alsa) { deps += [ "//chromecast/media/cma/backend/alsa:volume_control" ] - libs = [ "videodecoderformixer" ] + if (cast_static_videodecoderformixer_lib_target == "") { + libs = [ "videodecoderformixer" ] + } } if (is_fuchsia) { diff --git a/chromium/chromecast/metrics/BUILD.gn b/chromium/chromecast/metrics/BUILD.gn index aab5fa8f3ca..b5d76578403 100644 --- a/chromium/chromecast/metrics/BUILD.gn +++ b/chromium/chromecast/metrics/BUILD.gn @@ -2,24 +2,49 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//chromecast/build/tests/cast_test.gni") import("//chromecast/chromecast.gni") cast_source_set("metrics") { - sources = [ - "cast_metrics_service_client.cc", - "cast_metrics_service_client.h", + public = [ "cast_metrics_service_client.h" ] + + sources = [ "cast_metrics_service_client.cc" ] + + public_deps = [ + "//chromecast/base:cast_sys_info_util", + "//third_party/metrics_proto", ] deps = [ "//base", "//base:i18n", "//chromecast/base", - "//chromecast/base:cast_sys_info_util", "//chromecast/base:cast_version", "//components/metrics", "//components/metrics:net", "//components/prefs", "//services/network/public/cpp", - "//third_party/metrics_proto", ] } + +test("cast_metrics_unittest") { + sources = [ + "cast_metrics_service_client_unittest.cc", + "mock_cast_sys_info_util.cc", + "mock_cast_sys_info_util.h", + ] + + deps = [ + ":metrics", + "//base/test:run_all_unittests", + "//base/test:test_support", + "//chromecast/base:dummy_cast_sys_info", + "//services/network/public/cpp", + "//testing/gmock:gmock", + "//testing/gtest:gtest", + ] +} + +cast_test_group("metrics_cast_test_group") { + tests = [ ":cast_metrics_unittest" ] +} diff --git a/chromium/chromecast/renderer/BUILD.gn b/chromium/chromecast/renderer/BUILD.gn index d5926382b16..2fbd87926af 100644 --- a/chromium/chromecast/renderer/BUILD.gn +++ b/chromium/chromecast/renderer/BUILD.gn @@ -32,8 +32,6 @@ cast_source_set("renderer") { "cast_activity_url_filter_manager.h", "cast_content_renderer_client.cc", "cast_content_renderer_client.h", - "cast_media_playback_options.cc", - "cast_media_playback_options.h", "cast_url_loader_throttle_provider.cc", "cast_url_loader_throttle_provider.h", "cast_websocket_handshake_throttle_provider.cc", @@ -68,6 +66,7 @@ cast_source_set("renderer") { "//chromecast/crash", "//chromecast/media", "//chromecast/media/base:media_codec_support", + "//components/media_control/renderer", "//components/network_hints/renderer", "//content/public/common", "//content/public/renderer", diff --git a/chromium/chromecast/ui/BUILD.gn b/chromium/chromecast/ui/BUILD.gn index 5e7e55a69b8..ce674d948c3 100644 --- a/chromium/chromecast/ui/BUILD.gn +++ b/chromium/chromecast/ui/BUILD.gn @@ -13,6 +13,38 @@ cast_source_set("public") { deps = [ "//base" ] } +cast_source_set("display_settings_public") { + sources = [ + "display_settings_manager.cc", + "display_settings_manager.h", + ] + + deps = [ + "//base", + "//chromecast/ui/mojom", + "//mojo/public/cpp/bindings", + "//ui/display/types", + ] +} + +cast_source_set("display_settings_manager") { + sources = [ + "display_settings_manager_impl.cc", + "display_settings_manager_impl.h", + ] + + deps = [ + ":display_settings_public", + "//base", + "//chromecast/browser", + "//chromecast/graphics", + "//chromecast/ui/display_settings", + "//chromecast/ui/mojom", + "//mojo/public/cpp/bindings", + "//ui/display/types", + ] +} + cast_source_set("aura_components") { sources = [ "aura_components.h" ] diff --git a/chromium/chromecast/ui/display_settings/BUILD.gn b/chromium/chromecast/ui/display_settings/BUILD.gn new file mode 100644 index 00000000000..c3d1099a544 --- /dev/null +++ b/chromium/chromecast/ui/display_settings/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright 2020 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//chromecast/chromecast.gni") + +cast_source_set("display_settings") { + sources = [ + "brightness_animation.cc", + "brightness_animation.h", + "color_temperature_animation.cc", + "color_temperature_animation.h", + ] + + deps = [ + "//base", + "//chromecast/browser", + "//chromecast/graphics", + "//chromecast/ui:display_settings_public", + "//skia", + "//ui/compositor", + "//ui/display/types", + "//ui/gfx/animation", + ] + + if (use_aura) { + sources += [ + "gamma_configurator.cc", + "gamma_configurator.h", + ] + + deps += [ "//ui/aura" ] + } +} diff --git a/chromium/chromecast/ui/mojom/BUILD.gn b/chromium/chromecast/ui/mojom/BUILD.gn index f4db663699c..11cb827f4fb 100644 --- a/chromium/chromecast/ui/mojom/BUILD.gn +++ b/chromium/chromecast/ui/mojom/BUILD.gn @@ -6,7 +6,12 @@ import("//mojo/public/tools/bindings/mojom.gni") mojom("mojom") { sources = [ + "display_settings.mojom", "media_control_ui.mojom", "ui_service.mojom", ] + + public_deps = [ + "//mojo/public/mojom/base", + ] } diff --git a/chromium/chromecast/ui/mojom/display_settings.mojom b/chromium/chromecast/ui/mojom/display_settings.mojom new file mode 100644 index 00000000000..34ad2867e56 --- /dev/null +++ b/chromium/chromecast/ui/mojom/display_settings.mojom @@ -0,0 +1,41 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module chromecast.mojom; + +import "mojo/public/mojom/base/time.mojom"; + +// Interface for controlling device display settings. Each setting can be reset +// to its default value via Reset() methods. +// This interface is hosted in the browser process. +interface DisplaySettings { + // Sets display temperature value. + SetColorTemperature(float kelvin); + // Same as above, but temperature will be changed smoothly over a duration. + SetColorTemperatureSmooth(float kelvin, mojo_base.mojom.TimeDelta duration); + // Resets the display temperature value to the neutral value. + ResetColorTemperature(); + + // Sets display brightness from 0.0 to 1.0. The interpretation of this value + // is up to the platform implementation. + SetBrightness(float brightness); + // Same as above, but if the second argument is set, brightness will be + // changed smoothly over a duration. + SetBrightnessSmooth(float brightness, mojo_base.mojom.TimeDelta duration); + // Resets display brightness to the default value. + ResetBrightness(); + + // Sets whether screen should be on. If set to false, then screen will always + // be off and other settings will not be applied. + SetScreenOn(bool display_on); + + // Adds an observer to DisplaySettings. + AddDisplaySettingsObserver(pending_remote observer); +}; + +// Observer for display settings changes. +interface DisplaySettingsObserver { + // Receive a new display brightness. + OnDisplayBrightnessChanged(float brightness); +}; -- cgit v1.2.1