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

Unified Diff: chrome/browser/ui/views/infobars/infobar_view.cc

Issue 1767363002: [md] Give each infobar its own layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: true intersection Created 4 years, 9 months 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 | « chrome/browser/ui/views/infobars/infobar_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/infobars/infobar_view.cc
diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc
index 041283e5ad2b40ed9fc2b4e84592604ff26a3dac..390c7aa2cf0dcb0f9f37f243ba065dfefa1a8a30 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.cc
+++ b/chrome/browser/ui/views/infobars/infobar_view.cc
@@ -85,10 +85,14 @@ InfoBarView::InfoBarView(scoped_ptr<infobars::InfoBarDelegate> delegate)
set_owned_by_client(); // InfoBar deletes itself at the appropriate time.
set_background(
new InfoBarBackground(infobars::InfoBar::delegate()->GetInfoBarType()));
+ SetEventTargeter(make_scoped_ptr(new views::ViewTargeter(this)));
AddChildView(child_container_);
if (ui::MaterialDesignController::IsModeMaterial()) {
+ SetPaintToLayer(true);
+ layer()->SetFillsBoundsOpaquely(false);
+
child_container_->SetPaintToLayer(true);
child_container_->layer()->SetMasksToBounds(true);
// Since MD doesn't use a gradient, we can set a solid bg color.
@@ -425,3 +429,12 @@ void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) {
NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
}
}
+
+bool InfoBarView::DoesIntersectRect(const View* target,
+ const gfx::Rect& rect) const {
+ DCHECK_EQ(this, target);
+ // Only events that intersect the portion below the arrow are interesting.
+ gfx::Rect non_arrow_bounds = GetLocalBounds();
+ non_arrow_bounds.Inset(0, arrow_height(), 0, 0);
+ return rect.Intersects(non_arrow_bounds);
Evan Stade 2016/03/14 23:23:47 turns out Intersects is required to fix bug 593640
+}
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698