Index: ui/message_center/views/message_view.cc |
diff --git a/ui/message_center/views/message_view.cc b/ui/message_center/views/message_view.cc |
index a1fa32c3faa1cfdd9c55a4834a6082574dd81dd7..7591a5bf9f6de1d0401ebdb6c965e140af000488 100644 |
--- a/ui/message_center/views/message_view.cc |
+++ b/ui/message_center/views/message_view.cc |
@@ -25,7 +25,6 @@ |
#include "ui/views/controls/scroll_view.h" |
#include "ui/views/focus/focus_manager.h" |
#include "ui/views/painter.h" |
-#include "ui/views/widget/widget.h" |
namespace { |
@@ -65,8 +64,7 @@ |
const Notification& notification) |
: controller_(controller), |
notification_id_(notification.id()), |
- notifier_id_(notification.notifier_id()), |
- slide_out_controller_(this, this) { |
+ notifier_id_(notification.notifier_id()) { |
SetFocusBehavior(FocusBehavior::ALWAYS); |
// Create the opaque background that's above the view's shadow. |
@@ -87,7 +85,7 @@ |
void MessageView::UpdateWithNotification(const Notification& notification) { |
display_source_ = notification.display_source(); |
accessible_name_ = CreateAccessibleName(notification); |
- slide_out_controller_.set_enabled(!notification.pinned()); |
+ set_slide_out_enabled(!notification.pinned()); |
} |
// static |
@@ -96,11 +94,7 @@ |
gfx::ShadowDetails::Get(kShadowElevation, kShadowCornerRadius).values); |
} |
-void MessageView::SetIsNested() { |
- is_nested_ = true; |
- SetPaintToLayer(); |
- layer()->SetFillsBoundsOpaquely(false); |
- |
+void MessageView::CreateShadowBorder() { |
const auto& shadow = |
gfx::ShadowDetails::Get(kShadowElevation, kShadowCornerRadius); |
gfx::Insets ninebox_insets = gfx::ShadowValue::GetBlurRegion(shadow.values) + |
@@ -151,15 +145,18 @@ |
} |
void MessageView::OnPaint(gfx::Canvas* canvas) { |
+ SlideOutView::OnPaint(canvas); |
views::Painter::PaintFocusPainter(this, canvas, focus_painter_.get()); |
} |
void MessageView::OnFocus() { |
+ SlideOutView::OnFocus(); |
// We paint a focus indicator. |
SchedulePaint(); |
} |
void MessageView::OnBlur() { |
+ SlideOutView::OnBlur(); |
// We paint a focus indicator. |
SchedulePaint(); |
} |
@@ -202,6 +199,11 @@ |
} |
} |
+ SlideOutView::OnGestureEvent(event); |
+ // Do not return here by checking handled(). SlideOutView calls SetHandled() |
+ // even though the scroll gesture doesn't make no (or little) effects on the |
+ // slide-out behavior. See http://crbug.com/172991 |
+ |
if (!event->IsScrollGestureEvent() && !event->IsFlingScrollEvent()) |
return; |
@@ -210,15 +212,11 @@ |
event->SetHandled(); |
} |
-ui::Layer* MessageView::GetSlideOutLayer() { |
- return is_nested_ ? layer() : GetWidget()->GetLayer(); |
+void MessageView::OnCloseButtonPressed() { |
+ controller_->RemoveNotification(notification_id_, true); // By user. |
} |
void MessageView::OnSlideOut() { |
- controller_->RemoveNotification(notification_id_, true); // By user. |
-} |
- |
-void MessageView::OnCloseButtonPressed() { |
controller_->RemoveNotification(notification_id_, true); // By user. |
} |