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

Unified Diff: ui/arc/notification/arc_custom_notification_view.h

Issue 2221073002: arc: Custom notification improvements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for #3 Created 4 years, 4 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 | « ui/arc/notification/DEPS ('k') | ui/arc/notification/arc_custom_notification_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/arc/notification/arc_custom_notification_view.h
diff --git a/ui/arc/notification/arc_custom_notification_view.h b/ui/arc/notification/arc_custom_notification_view.h
index c10f3a2310a776e79e81af00f21b0890dfc0a6f1..4f2a4e3ebc1cb65dbdf1214f5632b4dc8ad45759 100644
--- a/ui/arc/notification/arc_custom_notification_view.h
+++ b/ui/arc/notification/arc_custom_notification_view.h
@@ -35,13 +35,22 @@ class ArcCustomNotificationView : public views::NativeViewHost,
~ArcCustomNotificationView() override;
private:
+ class EventForwarder;
+ class SlideHelper;
+
void CreateFloatingCloseButton();
+ void SetSurface(exo::NotificationSurface* surface);
void UpdatePreferredSize();
+ void UpdateCloseButtonVisiblity();
// views::NativeViewHost
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
void Layout() override;
+ void OnKeyEvent(ui::KeyEvent* event) override;
+ void OnGestureEvent(ui::GestureEvent* event) override;
+ void OnMouseEntered(const ui::MouseEvent& event) override;
+ void OnMouseExited(const ui::MouseEvent& event) override;
// views::ButtonListener
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
@@ -57,8 +66,19 @@ class ArcCustomNotificationView : public views::NativeViewHost,
void OnItemPinnedChanged() override;
void OnItemNotificationSurfaceRemoved() override;
- ArcCustomNotificationItem* item_;
- exo::NotificationSurface* surface_;
+ ArcCustomNotificationItem* item_ = nullptr;
+ exo::NotificationSurface* surface_ = nullptr;
+
+ // A pre-target event handler to forward events on the surface to this view.
+ // Using a pre-target event handler instead of a target handler on the surface
+ // window because it has descendant aura::Window and the events on them need
+ // to be handled as well.
+ // TODO(xiyuan): Revisit after exo::Surface no longer has an aura::Window.
+ std::unique_ptr<EventForwarder> event_forwarder_;
+
+ // A helper to observe slide transform/animation and use surface layer copy
+ // when a slide is in progress and restore the surface when it finishes.
+ std::unique_ptr<SlideHelper> slide_helper_;
// A close button on top of NotificationSurface. Needed because the
// aura::Window of NotificationSurface is added after hosting widget's
« no previous file with comments | « ui/arc/notification/DEPS ('k') | ui/arc/notification/arc_custom_notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698