Commit c1737f4e authored by minch's avatar minch Committed by Commit Bot

dark_mode: Remove UnifiedSystemTrayView::CreateBackground.

Call sites of UnifiedSystemTrayView::CreateBackground have been removed
at crrev.com/c/2015577. The background of system tray now is controlled
inside TrayBubbleView by UnifiedSystemTrayView::GetBackgroundColor().

SwitchAccessBackButtonView doesn't inherit from TrayBubbleView, it
should not use the related logic. And its color is actually controlled
inside SwitchAccessBackButtonView::OnPaint.

Bug: 1107056
Change-Id: I13a8ac764fa6fbaa1dede9bdc7b3f6fedfe95b14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2430323Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810483}
parent b4efe144
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "ash/system/accessibility/switch_access_back_button_view.h" #include "ash/system/accessibility/switch_access_back_button_view.h"
#include "ash/system/tray/tray_background_view.h" #include "ash/system/tray/tray_background_view.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ash/system/unified/unified_system_tray_view.h"
#include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_enums.mojom.h"
#include "ui/display/display.h" #include "ui/display/display.h"
#include "ui/display/screen.h" #include "ui/display/screen.h"
...@@ -31,7 +30,6 @@ void SwitchAccessBackButtonBubbleController::ShowBackButton( ...@@ -31,7 +30,6 @@ void SwitchAccessBackButtonBubbleController::ShowBackButton(
bool for_menu) { bool for_menu) {
if (!widget_) { if (!widget_) {
back_button_view_ = new SwitchAccessBackButtonView(for_menu); back_button_view_ = new SwitchAccessBackButtonView(for_menu);
back_button_view_->SetBackground(UnifiedSystemTrayView::CreateBackground());
TrayBubbleView::InitParams init_params; TrayBubbleView::InitParams init_params;
init_params.delegate = this; init_params.delegate = this;
...@@ -43,11 +41,11 @@ void SwitchAccessBackButtonBubbleController::ShowBackButton( ...@@ -43,11 +41,11 @@ void SwitchAccessBackButtonBubbleController::ShowBackButton(
init_params.is_anchored_to_status_area = false; init_params.is_anchored_to_status_area = false;
init_params.has_shadow = false; init_params.has_shadow = false;
init_params.preferred_width = back_button_view_->size().width(); init_params.preferred_width = back_button_view_->size().width();
init_params.translucent = true;
bubble_view_ = new TrayBubbleView(init_params); bubble_view_ = new TrayBubbleView(init_params);
bubble_view_->SetArrow(views::BubbleBorder::BOTTOM_RIGHT); bubble_view_->SetArrow(views::BubbleBorder::BOTTOM_RIGHT);
bubble_view_->AddChildView(back_button_view_); bubble_view_->AddChildView(back_button_view_);
bubble_view_->set_color(SK_ColorTRANSPARENT);
bubble_view_->SetPaintToLayer(); bubble_view_->SetPaintToLayer();
bubble_view_->layer()->SetFillsBoundsOpaquely(false); bubble_view_->layer()->SetFillsBoundsOpaquely(false);
......
...@@ -183,13 +183,6 @@ SkColor UnifiedSystemTrayView::GetFocusRingColor() { ...@@ -183,13 +183,6 @@ SkColor UnifiedSystemTrayView::GetFocusRingColor() {
return ShelfConfig::Get()->shelf_focus_border_color(); return ShelfConfig::Get()->shelf_focus_border_color();
} }
// static
std::unique_ptr<views::Background> UnifiedSystemTrayView::CreateBackground() {
return views::CreateBackgroundFromPainter(
views::Painter::CreateSolidRoundRectPainter(GetBackgroundColor(),
kUnifiedTrayCornerRadius));
}
UnifiedSystemTrayView::UnifiedSystemTrayView( UnifiedSystemTrayView::UnifiedSystemTrayView(
UnifiedSystemTrayController* controller, UnifiedSystemTrayController* controller,
bool initially_expanded) bool initially_expanded)
......
...@@ -71,9 +71,6 @@ class ASH_EXPORT UnifiedSystemTrayView : public views::View, ...@@ -71,9 +71,6 @@ class ASH_EXPORT UnifiedSystemTrayView : public views::View,
// Get focus ring color for system tray elements. // Get focus ring color for system tray elements.
static SkColor GetFocusRingColor(); static SkColor GetFocusRingColor();
// Create background of UnifiedSystemTray with rounded corners.
static std::unique_ptr<views::Background> CreateBackground();
UnifiedSystemTrayView(UnifiedSystemTrayController* controller, UnifiedSystemTrayView(UnifiedSystemTrayController* controller,
bool initially_expanded); bool initially_expanded);
~UnifiedSystemTrayView() override; ~UnifiedSystemTrayView() override;
......
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