Commit ee0ed7af authored by Jazz Xu's avatar Jazz Xu Committed by Commit Bot

CrOS GMC: Set color theme when opening dialog and detailed view.

Bug: 1146552
Change-Id: I6b4ee181e0b62044892b2649033f426544f25c04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526703
Commit-Queue: Jazz Xu <jazzhsu@chromium.org>
Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825989}
parent 36b2a7ba
...@@ -197,7 +197,6 @@ void MediaTray::PinButton::ButtonPressed() { ...@@ -197,7 +197,6 @@ void MediaTray::PinButton::ButtonPressed() {
MediaTray::MediaTray(Shelf* shelf) : TrayBackgroundView(shelf) { MediaTray::MediaTray(Shelf* shelf) : TrayBackgroundView(shelf) {
if (MediaNotificationProvider::Get()) if (MediaNotificationProvider::Get())
MediaNotificationProvider::Get()->AddObserver(this); MediaNotificationProvider::Get()->AddObserver(this);
SetNotificationColorTheme();
Shell::Get()->session_controller()->AddObserver(this); Shell::Get()->session_controller()->AddObserver(this);
...@@ -258,6 +257,7 @@ bool MediaTray::PerformAction(const ui::Event& event) { ...@@ -258,6 +257,7 @@ bool MediaTray::PerformAction(const ui::Event& event) {
void MediaTray::ShowBubble(bool show_by_click) { void MediaTray::ShowBubble(bool show_by_click) {
DCHECK(MediaNotificationProvider::Get()); DCHECK(MediaNotificationProvider::Get());
SetNotificationColorTheme();
TrayBubbleView::InitParams init_params; TrayBubbleView::InitParams init_params;
init_params.delegate = this; init_params.delegate = this;
......
...@@ -6,10 +6,12 @@ ...@@ -6,10 +6,12 @@
#include "ash/public/cpp/media_notification_provider.h" #include "ash/public/cpp/media_notification_provider.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h"
#include "ash/system/media/unified_media_controls_detailed_view.h" #include "ash/system/media/unified_media_controls_detailed_view.h"
#include "ash/system/tray/detailed_view_delegate.h" #include "ash/system/tray/detailed_view_delegate.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "components/media_message_center/media_notification_view_impl.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
namespace ash { namespace ash {
...@@ -35,6 +37,19 @@ UnifiedMediaControlsDetailedViewController:: ...@@ -35,6 +37,19 @@ UnifiedMediaControlsDetailedViewController::
views::View* UnifiedMediaControlsDetailedViewController::CreateView() { views::View* UnifiedMediaControlsDetailedViewController::CreateView() {
DCHECK(MediaNotificationProvider::Get()); DCHECK(MediaNotificationProvider::Get());
media_message_center::NotificationTheme theme;
theme.primary_text_color = AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary);
theme.secondary_text_color = AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorSecondary);
theme.enabled_icon_color = AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kIconColorPrimary);
theme.disabled_icon_color = AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kIconColorSecondary);
theme.separator_color = AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kSeparatorColor);
MediaNotificationProvider::Get()->SetColorTheme(theme);
base::UmaHistogramBoolean( base::UmaHistogramBoolean(
"Media.CrosGlobalMediaControls.RepeatUsageInQuickSetting", "Media.CrosGlobalMediaControls.RepeatUsageInQuickSetting",
detailed_view_has_shown_); detailed_view_has_shown_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment