Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Unified Diff: ash/common/system/tray/tray_popup_utils.cc

Issue 2510603003: Add ink drop ripple to status tray (Closed)
Patch Set: Addressed review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.h ('k') | ash/common/system/user/tray_user.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.h ('k') | ash/common/system/user/tray_user.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698