diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-06 12:48:11 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:33:43 +0000 |
commit | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (patch) | |
tree | fa14ba0ca8d2683ba2efdabd246dc9b18a1229c6 /chromium/components/media_message_center | |
parent | 79b4f909db1049fca459c07cca55af56a9b54fe3 (diff) | |
download | qtwebengine-chromium-7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3.tar.gz |
BASELINE: Update Chromium to 84.0.4147.141
Change-Id: Ib85eb4cfa1cbe2b2b81e5022c8cad5c493969535
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/media_message_center')
15 files changed, 256 insertions, 19 deletions
diff --git a/chromium/components/media_message_center/BUILD.gn b/chromium/components/media_message_center/BUILD.gn index 7412c7accfd..5fb78edf6f3 100644 --- a/chromium/components/media_message_center/BUILD.gn +++ b/chromium/components/media_message_center/BUILD.gn @@ -27,6 +27,7 @@ component("media_message_center") { deps = [ "//base", + "//components/media_message_center/vector_icons", "//components/strings:components_strings_grit", "//components/vector_icons", "//services/media_session/public/cpp", diff --git a/chromium/components/media_message_center/media_notification_view_impl.cc b/chromium/components/media_message_center/media_notification_view_impl.cc index 6d9e607fd1e..0c9661cf8d8 100644 --- a/chromium/components/media_message_center/media_notification_view_impl.cc +++ b/chromium/components/media_message_center/media_notification_view_impl.cc @@ -11,8 +11,8 @@ #include "components/media_message_center/media_notification_container.h" #include "components/media_message_center/media_notification_item.h" #include "components/media_message_center/media_notification_util.h" +#include "components/media_message_center/vector_icons/vector_icons.h" #include "components/strings/grit/components_strings.h" -#include "components/vector_icons/vector_icons.h" #include "services/media_session/public/mojom/media_session.mojom.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" @@ -62,21 +62,21 @@ void RecordMetadataHistogram(MediaNotificationViewImpl::Metadata metadata) { const gfx::VectorIcon* GetVectorIconForMediaAction(MediaSessionAction action) { switch (action) { case MediaSessionAction::kPreviousTrack: - return &vector_icons::kMediaPreviousTrackIcon; + return &kMediaPreviousTrackIcon; case MediaSessionAction::kSeekBackward: - return &vector_icons::kMediaSeekBackwardIcon; + return &kMediaSeekBackwardIcon; case MediaSessionAction::kPlay: - return &vector_icons::kPlayArrowIcon; + return &kPlayArrowIcon; case MediaSessionAction::kPause: - return &vector_icons::kPauseIcon; + return &kPauseIcon; case MediaSessionAction::kSeekForward: - return &vector_icons::kMediaSeekForwardIcon; + return &kMediaSeekForwardIcon; case MediaSessionAction::kNextTrack: - return &vector_icons::kMediaNextTrackIcon; + return &kMediaNextTrackIcon; case MediaSessionAction::kEnterPictureInPicture: - return &vector_icons::kMediaEnterPipIcon; + return &kMediaEnterPipIcon; case MediaSessionAction::kExitPictureInPicture: - return &vector_icons::kMediaExitPipIcon; + return &kMediaExitPipIcon; case MediaSessionAction::kStop: case MediaSessionAction::kSkipAd: case MediaSessionAction::kSeekTo: @@ -590,6 +590,7 @@ void MediaNotificationViewImpl::UpdateForegroundColor() { GetMediaNotificationBackground()->GetBackgroundColor(*this); const SkColor foreground = GetMediaNotificationBackground()->GetForegroundColor(*this); + const SkColor separator_color = SkColorSetA(foreground, 0x1F); title_label_->SetEnabledColor(foreground); artist_label_->SetEnabledColor(foreground); @@ -604,7 +605,7 @@ void MediaNotificationViewImpl::UpdateForegroundColor() { header_row_->SetBackgroundColor(background); pip_button_separator_view_->children().front()->SetBackground( - views::CreateSolidBackground(foreground)); + views::CreateSolidBackground(separator_color)); // Update play/pause button images. views::SetImageFromVectorIconWithColor( diff --git a/chromium/components/media_message_center/media_notification_view_impl.h b/chromium/components/media_message_center/media_notification_view_impl.h index 52db6cb00df..ac69fb54665 100644 --- a/chromium/components/media_message_center/media_notification_view_impl.h +++ b/chromium/components/media_message_center/media_notification_view_impl.h @@ -86,6 +86,10 @@ class COMPONENT_EXPORT(MEDIA_MESSAGE_CENTER) MediaNotificationViewImpl const views::Label* artist_label_for_testing() const { return artist_label_; } + const views::Button* picture_in_picture_button_for_testing() const { + return picture_in_picture_button_; + } + views::Button* GetHeaderRowForTesting() const; base::string16 GetSourceTitleForTesting() const; diff --git a/chromium/components/media_message_center/media_notification_view_impl_unittest.cc b/chromium/components/media_message_center/media_notification_view_impl_unittest.cc index 44b9b4e947c..b1840cf22e2 100644 --- a/chromium/components/media_message_center/media_notification_view_impl_unittest.cc +++ b/chromium/components/media_message_center/media_notification_view_impl_unittest.cc @@ -105,13 +105,11 @@ class MockMediaNotificationContainer : public MediaNotificationContainer { MOCK_METHOD2(OnColorsChanged, void(SkColor foreground, SkColor background)); MOCK_METHOD0(OnHeaderClicked, void()); - MediaNotificationViewImpl* view() const { return view_.get(); } - void SetView(std::unique_ptr<MediaNotificationViewImpl> view) { - view_ = std::move(view); - } + MediaNotificationViewImpl* view() const { return view_; } + void SetView(MediaNotificationViewImpl* view) { view_ = view; } private: - std::unique_ptr<MediaNotificationViewImpl> view_; + MediaNotificationViewImpl* view_; DISALLOW_COPY_AND_ASSIGN(MockMediaNotificationContainer); }; @@ -171,6 +169,7 @@ class MediaNotificationViewImplTest : public views::ViewsTestBase { } void TearDown() override { + container_.SetView(nullptr); widget_.reset(); actions_.clear(); @@ -324,13 +323,13 @@ class MediaNotificationViewImplTest : public views::ViewsTestBase { base::ASCIIToUTF16(kTestDefaultAppName), kViewWidth, /*should_show_icon=*/true); view->SetSize(kViewSize); - view->set_owned_by_client(); - // Display it in |widget_|. - widget_->SetContentsView(view.get()); + // Display it in |widget_|. Widget now owns |view|. + auto* view_ptr = view.get(); + widget_->SetContentsView(view.release()); // Associate it with |container_|. - container_.SetView(std::move(view)); + container_.SetView(view_ptr); } base::UnguessableToken request_id_; diff --git a/chromium/components/media_message_center/vector_icons/BUILD.gn b/chromium/components/media_message_center/vector_icons/BUILD.gn new file mode 100644 index 00000000000..4f197ada75d --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/BUILD.gn @@ -0,0 +1,31 @@ +# 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("//components/vector_icons/vector_icons.gni") + +aggregate_vector_icons("media_vector_icons") { + icon_directory = "." + + icons = [ + "media_enter_pip.icon", + "media_exit_pip.icon", + "media_next_track.icon", + "media_previous_track.icon", + "media_seek_forward.icon", + "media_seek_backward.icon", + "play_arrow.icon", + "pause.icon", + ] +} + +source_set("vector_icons") { + sources = get_target_outputs(":media_vector_icons") + + deps = [ + ":media_vector_icons", + "//base", + "//skia", + "//ui/gfx", + ] +} diff --git a/chromium/components/media_message_center/vector_icons/media_enter_pip.icon b/chromium/components/media_message_center/vector_icons/media_enter_pip.icon new file mode 100644 index 00000000000..132034d67ca --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/media_enter_pip.icon @@ -0,0 +1,27 @@ +// 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. + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 12, 7, +H_LINE_TO, 7, +R_V_LINE_TO, 4, +R_H_LINE_TO, 5, +V_LINE_TO, 7, +CLOSE, +R_MOVE_TO, 3, 5.67f, +V_LINE_TO, 3.32f, +CUBIC_TO, 15, 2.59f, 14.43f, 2, 13.73f, 2, +H_LINE_TO, 2.27f, +CUBIC_TO, 1.57f, 2, 1, 2.59f, 1, 3.32f, +R_V_LINE_TO, 9.35f, +CUBIC_TO, 1, 13.4f, 1.57f, 14, 2.27f, 14, +R_H_LINE_TO, 11.45f, +R_CUBIC_TO, 0.7f, 0, 1.27f, -0.6f, 1.27f, -1.33f, +CLOSE, +R_MOVE_TO, -1.5f, -0.17f, +R_H_LINE_TO, -11, +R_V_LINE_TO, -9, +R_H_LINE_TO, 11, +R_V_LINE_TO, 9, +CLOSE diff --git a/chromium/components/media_message_center/vector_icons/media_exit_pip.icon b/chromium/components/media_message_center/vector_icons/media_exit_pip.icon new file mode 100644 index 00000000000..87ea909ba50 --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/media_exit_pip.icon @@ -0,0 +1,39 @@ +// 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. + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 13.73f, 2, +R_CUBIC_TO, 0.7f, 0, 1.27f, 0.59f, 1.27f, 1.32f, +V_LINE_TO, 9, +R_H_LINE_TO, -1.5f, +V_LINE_TO, 3.5f, +R_H_LINE_TO, -11, +R_V_LINE_TO, 9, +H_LINE_TO, 9, +V_LINE_TO, 14, +H_LINE_TO, 2.27f, +CUBIC_TO, 1.57f, 14, 1, 13.4f, 1, 12.67f, +V_LINE_TO, 3.32f, +CUBIC_TO, 1, 2.59f, 1.57f, 2, 2.27f, 2, +CLOSE, +MOVE_TO, 9, 5, +H_LINE_TO, 4, +R_V_LINE_TO, 4, +R_H_LINE_TO, 5, +CLOSE, +MOVE_TO, 12, 10, +R_V_LINE_TO, 4, +R_H_LINE_TO, -1, +R_V_LINE_TO, -4, +CLOSE, +MOVE_TO, 11.71f, 10, +R_LINE_TO, 4.24f, 4.24f, +R_LINE_TO, -0.71f, 0.71f, +LINE_TO, 11, 10.71f, +CLOSE, +MOVE_TO, 11, 10, +R_H_LINE_TO, 4, +R_V_LINE_TO, 1, +R_H_LINE_TO, -4, +CLOSE
\ No newline at end of file diff --git a/chromium/components/media_message_center/vector_icons/media_next_track.icon b/chromium/components/media_message_center/vector_icons/media_next_track.icon new file mode 100644 index 00000000000..44cbc331b88 --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/media_next_track.icon @@ -0,0 +1,16 @@ +// 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. + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 3, 13, +LINE_TO, 9, 8, +LINE_TO, 3, 3, +LINE_TO, 3, 13, +CLOSE, +MOVE_TO, 11, 3, +LINE_TO, 11, 13, +LINE_TO, 13, 13, +LINE_TO, 13, 3, +LINE_TO, 11, 3, +CLOSE
\ No newline at end of file diff --git a/chromium/components/media_message_center/vector_icons/media_previous_track.icon b/chromium/components/media_message_center/vector_icons/media_previous_track.icon new file mode 100644 index 00000000000..7efd0cd822e --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/media_previous_track.icon @@ -0,0 +1,16 @@ +// 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. + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 3, 3, +LINE_TO, 5, 3, +LINE_TO, 5, 13, +LINE_TO, 3, 13, +LINE_TO, 3, 3, +CLOSE, +MOVE_TO, 7, 8, +LINE_TO, 13, 13, +LINE_TO, 13, 3, +LINE_TO, 7, 8, +CLOSE
\ No newline at end of file diff --git a/chromium/components/media_message_center/vector_icons/media_seek_backward.icon b/chromium/components/media_message_center/vector_icons/media_seek_backward.icon new file mode 100644 index 00000000000..c3f49cc8ed4 --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/media_seek_backward.icon @@ -0,0 +1,15 @@ +// 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. + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 8, 13, +LINE_TO, 8, 3, +LINE_TO, 2, 8, +LINE_TO, 8, 13, +CLOSE, +MOVE_TO, 8, 8, +LINE_TO, 14, 13, +LINE_TO, 14, 3, +LINE_TO, 8, 8, +CLOSE
\ No newline at end of file diff --git a/chromium/components/media_message_center/vector_icons/media_seek_forward.icon b/chromium/components/media_message_center/vector_icons/media_seek_forward.icon new file mode 100644 index 00000000000..45b63c5e7be --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/media_seek_forward.icon @@ -0,0 +1,15 @@ +// 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. + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 2, 13, +LINE_TO, 8, 8, +LINE_TO, 2, 3, +LINE_TO, 2, 13, +CLOSE, +MOVE_TO, 8, 3, +LINE_TO, 8, 13, +LINE_TO, 14, 8, +LINE_TO, 8, 3, +CLOSE
\ No newline at end of file diff --git a/chromium/components/media_message_center/vector_icons/pause.icon b/chromium/components/media_message_center/vector_icons/pause.icon new file mode 100644 index 00000000000..fde32f0616e --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/pause.icon @@ -0,0 +1,17 @@ +// 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. + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 7, 2, +LINE_TO, 7, 14, +LINE_TO, 4, 14, +LINE_TO, 4, 2, +LINE_TO, 7, 2, +CLOSE, +MOVE_TO, 12, 2, +LINE_TO, 12, 14, +LINE_TO, 9, 14, +LINE_TO, 9, 2, +LINE_TO, 12, 2, +CLOSE
\ No newline at end of file diff --git a/chromium/components/media_message_center/vector_icons/play_arrow.icon b/chromium/components/media_message_center/vector_icons/play_arrow.icon new file mode 100644 index 00000000000..dbee57f7138 --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/play_arrow.icon @@ -0,0 +1,9 @@ +// 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. + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 6, 13, +R_LINE_TO, 6, -5, +R_LINE_TO, -6, -5, +CLOSE
\ No newline at end of file diff --git a/chromium/components/media_message_center/vector_icons/vector_icons.cc.template b/chromium/components/media_message_center/vector_icons/vector_icons.cc.template new file mode 100644 index 00000000000..bb267d3110f --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/vector_icons.cc.template @@ -0,0 +1,21 @@ +// 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. + +// vector_icons.cc.template is used to generate vector_icons.cc. Edit the former +// rather than the latter. + +#include "components/media_message_center/vector_icons/vector_icons.h" + +#include "base/logging.h" +#include "components/vector_icons/cc_macros.h" +#include "ui/gfx/vector_icon_types.h" + +#define DECLARE_VECTOR_COMMAND(x) using gfx::x; +DECLARE_VECTOR_COMMANDS + +namespace media_message_center { + +TEMPLATE_PLACEHOLDER + +} diff --git a/chromium/components/media_message_center/vector_icons/vector_icons.h.template b/chromium/components/media_message_center/vector_icons/vector_icons.h.template new file mode 100644 index 00000000000..b37721f3bb4 --- /dev/null +++ b/chromium/components/media_message_center/vector_icons/vector_icons.h.template @@ -0,0 +1,26 @@ +// 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. + +// vector_icons.h.template is used to generate vector_icons.h. Edit the former +// rather than the latter. + +#ifndef COMPONENTS_MEDIA_MESSAGE_CENTER_VECTOR_ICONS_H_ +#define COMPONENTS_MEDIA_MESSAGE_CENTER_VECTOR_ICONS_H_ + +namespace gfx { +struct VectorIcon; +} + +namespace media_message_center { + +#define VECTOR_ICON_TEMPLATE_H(icon_name) \ +extern const gfx::VectorIcon icon_name; + +TEMPLATE_PLACEHOLDER + +#undef VECTOR_ICON_TEMPLATE_H + +} + +#endif // COMPONENTS_MEDIA_MESSAGE_CENTER_VECTOR_ICONS_H_ |