Commit 03507dbe authored by Andre Le's avatar Andre Le Committed by Chromium LUCI CQ

Notification: Avoid setting border twice in message view.

The regression bug below was caused by crrev/c/2108573, where we
mistakenly setting border twice in message view (one in OnThemeChanged()
and one in SetIsNested()). We don't need to set border in
OnThemeChanged() if we have done so in SetIsNested(), so this CL remove
that function call.

Fixed: 1073561
Change-Id: Iaa74b630e0b4d9d2bac7ac9f0c5edf182b1eb89a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2606266Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Andre Le <leandre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841000}
parent 60e867a2
...@@ -132,7 +132,11 @@ void MessageView::SetIsNested() { ...@@ -132,7 +132,11 @@ void MessageView::SetIsNested() {
slide_out_controller_.set_slide_mode(CalculateSlideMode()); slide_out_controller_.set_slide_mode(CalculateSlideMode());
slide_out_controller_.set_update_opacity(false); slide_out_controller_.set_update_opacity(false);
SetNestedBorderIfNecessary(); SkColor border_color = GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_UnfocusedBorderColor);
SetBorder(views::CreateRoundedRectBorder(
kNotificationBorderThickness, kNotificationCornerRadius, border_color));
if (GetControlButtonsView()) if (GetControlButtonsView())
GetControlButtonsView()->ShowCloseButton(GetMode() != Mode::PINNED); GetControlButtonsView()->ShowCloseButton(GetMode() != Mode::PINNED);
} }
...@@ -327,7 +331,6 @@ void MessageView::AddedToWidget() { ...@@ -327,7 +331,6 @@ void MessageView::AddedToWidget() {
void MessageView::OnThemeChanged() { void MessageView::OnThemeChanged() {
InkDropHostView::OnThemeChanged(); InkDropHostView::OnThemeChanged();
UpdateBackgroundPainter(); UpdateBackgroundPainter();
SetNestedBorderIfNecessary();
} }
ui::Layer* MessageView::GetSlideOutLayer() { ui::Layer* MessageView::GetSlideOutLayer() {
...@@ -469,15 +472,6 @@ bool MessageView::ShouldShowControlButtons() const { ...@@ -469,15 +472,6 @@ bool MessageView::ShouldShowControlButtons() const {
#endif #endif
} }
void MessageView::SetNestedBorderIfNecessary() {
if (is_nested_) {
SkColor border_color = GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_UnfocusedBorderColor);
SetBorder(views::CreateRoundedRectBorder(
kNotificationBorderThickness, kNotificationCornerRadius, border_color));
}
}
void MessageView::UpdateBackgroundPainter() { void MessageView::UpdateBackgroundPainter() {
SkColor background_color = GetNativeTheme()->GetSystemColor( SkColor background_color = GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_NotificationDefaultBackground); ui::NativeTheme::kColorId_NotificationDefaultBackground);
......
...@@ -205,9 +205,6 @@ class MESSAGE_CENTER_EXPORT MessageView ...@@ -205,9 +205,6 @@ class MESSAGE_CENTER_EXPORT MessageView
// Returns if the control buttons should be shown. // Returns if the control buttons should be shown.
bool ShouldShowControlButtons() const; bool ShouldShowControlButtons() const;
// Sets the border if |is_nested_| is true.
void SetNestedBorderIfNecessary();
// Updates the background painter using the themed background color and radii. // Updates the background painter using the themed background color and radii.
void UpdateBackgroundPainter(); void UpdateBackgroundPainter();
......
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