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

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

Issue 2499523003: Add ink drop masking to TrayBackgroundView (Closed)
Patch Set: 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
Index: ash/common/system/tray/tray_background_view.cc
diff --git a/ash/common/system/tray/tray_background_view.cc b/ash/common/system/tray/tray_background_view.cc
index 8884948369ebfe1982dc0f33ddc6589f92eee130..e35b85cc2ac164cf111df2f3406b1f4e44f1e5eb 100644
--- a/ash/common/system/tray/tray_background_view.cc
+++ b/ash/common/system/tray/tray_background_view.cc
@@ -35,6 +35,7 @@
#include "ui/gfx/transform.h"
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop_highlight.h"
+#include "ui/views/animation/ink_drop_mask.h"
#include "ui/views/background.h"
#include "ui/views/layout/box_layout.h"
#include "ui/wm/core/window_animations.h"
@@ -376,6 +377,22 @@ void TrayBackgroundView::AboutToRequestFocusFromTabTraversal(bool reverse) {
v->AboutToRequestFocusFromTabTraversal(reverse);
}
+void TrayBackgroundView::AddInkDropLayer(ui::Layer* ink_drop_layer) {
+ gfx::Rect local_bounds = GetLocalBounds();
+ ink_drop_layer->SetBounds(local_bounds);
bruthig 2016/11/11 20:16:43 Capturing offline discussion: Let's move the owner
mohsen 2016/11/13 23:31:28 Done.
+ ink_drop_mask_.reset(new views::RoundRectInkDropMask(
+ local_bounds, GetBackgroundBounds(GetContentsBounds(), shelf_alignment_),
+ kTrayRoundedBorderRadius));
+ ink_drop_layer->SetMaskLayer(ink_drop_mask_->layer());
+ ActionableView::AddInkDropLayer(ink_drop_layer);
+}
+
+void TrayBackgroundView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
+ ActionableView::RemoveInkDropLayer(ink_drop_layer);
+ ink_drop_layer->SetMaskLayer(nullptr);
+ ink_drop_mask_.reset();
+}
+
std::unique_ptr<views::InkDropRipple> TrayBackgroundView::CreateInkDropRipple()
const {
return base::MakeUnique<views::FloodFillInkDropRipple>(

Powered by Google App Engine
This is Rietveld 408576698