| Index: ash/common/system/tray/tray_popup_utils.cc
|
| diff --git a/ash/common/system/tray/tray_popup_utils.cc b/ash/common/system/tray/tray_popup_utils.cc
|
| index c79b42a2e7f9716a338e054f23ed50be89579212..89410f174a462442e7d4e3e3d4aab62b7a122276 100644
|
| --- a/ash/common/system/tray/tray_popup_utils.cc
|
| +++ b/ash/common/system/tray/tray_popup_utils.cc
|
| @@ -344,17 +344,21 @@ std::unique_ptr<views::InkDropMask> TrayPopupUtils::CreateInkDropMask(
|
| return nullptr;
|
|
|
| const gfx::Size layer_size = host->size();
|
| - const gfx::Rect mask_bounds = GetInkDropBounds(ink_drop_style, host);
|
| switch (ink_drop_style) {
|
| case TrayPopupInkDropStyle::HOST_CENTERED: {
|
| + const gfx::Rect mask_bounds =
|
| + GetInkDropBounds(TrayPopupInkDropStyle::HOST_CENTERED, host);
|
| const int radius =
|
| std::min(mask_bounds.width(), mask_bounds.height()) / 2;
|
| return base::MakeUnique<views::CircleInkDropMask>(
|
| layer_size, mask_bounds.CenterPoint(), radius);
|
| }
|
| - case TrayPopupInkDropStyle::INSET_BOUNDS:
|
| + case TrayPopupInkDropStyle::INSET_BOUNDS: {
|
| + const gfx::Insets mask_insets =
|
| + GetInkDropInsets(TrayPopupInkDropStyle::INSET_BOUNDS);
|
| return base::MakeUnique<views::RoundRectInkDropMask>(
|
| - layer_size, mask_bounds, kTrayPopupInkDropCornerRadius);
|
| + layer_size, mask_insets, kTrayPopupInkDropCornerRadius);
|
| + }
|
| case TrayPopupInkDropStyle::FILL_BOUNDS:
|
| // Handled by quick return above.
|
| break;
|
| @@ -364,13 +368,21 @@ std::unique_ptr<views::InkDropMask> TrayPopupUtils::CreateInkDropMask(
|
| return nullptr;
|
| }
|
|
|
| -gfx::Rect TrayPopupUtils::GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style,
|
| - const views::View* host) {
|
| - gfx::Rect bounds = host->GetLocalBounds();
|
| +gfx::Insets TrayPopupUtils::GetInkDropInsets(
|
| + TrayPopupInkDropStyle ink_drop_style) {
|
| + gfx::Insets insets;
|
| if (ink_drop_style == TrayPopupInkDropStyle::HOST_CENTERED ||
|
| ink_drop_style == TrayPopupInkDropStyle::INSET_BOUNDS) {
|
| - bounds.Inset(kTrayPopupInkDropInset, kTrayPopupInkDropInset);
|
| + insets.Set(kTrayPopupInkDropInset, kTrayPopupInkDropInset,
|
| + kTrayPopupInkDropInset, kTrayPopupInkDropInset);
|
| }
|
| + return insets;
|
| +}
|
| +
|
| +gfx::Rect TrayPopupUtils::GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style,
|
| + const views::View* host) {
|
| + gfx::Rect bounds = host->GetLocalBounds();
|
| + bounds.Inset(GetInkDropInsets(ink_drop_style));
|
| return bounds;
|
| }
|
|
|
|
|