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 e5de7e93e56835ddabb980b7ebf4a2d74fd11f78..4505f269073b647e33cc923565cb95fde32f9b00 100644 |
--- a/ui/arc/notification/arc_custom_notification_view.h |
+++ b/ui/arc/notification/arc_custom_notification_view.h |
@@ -5,29 +5,59 @@ |
#ifndef UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ |
#define UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ |
+#include <memory> |
#include <string> |
#include "base/macros.h" |
+#include "ui/arc/notification/arc_custom_notification_item.h" |
+#include "ui/views/controls/button/button.h" |
#include "ui/views/controls/native/native_view_host.h" |
namespace exo { |
class NotificationSurface; |
} |
+namespace views { |
+class ImageButton; |
+class Widget; |
+} |
+ |
namespace arc { |
-class ArcCustomNotificationView : public views::NativeViewHost { |
+class ArcCustomNotificationView : public views::NativeViewHost, |
+ public views::ButtonListener, |
+ public ArcCustomNotificationItem::Observer { |
public: |
- explicit ArcCustomNotificationView(exo::NotificationSurface* surface); |
+ ArcCustomNotificationView(ArcCustomNotificationItem* item, |
+ exo::NotificationSurface* surface); |
~ArcCustomNotificationView() override; |
private: |
+ void CreateFloatingCloseButton(); |
+ |
// views::NativeViewHost |
void ViewHierarchyChanged( |
const ViewHierarchyChangedDetails& details) override; |
+ void Layout() override; |
+ |
+ // views::ButtonListener |
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
+ // ArcCustomNotificationItem::Observer |
+ void OnItemDestroying() override; |
+ void OnItemPinnedChanged() override; |
+ |
+ ArcCustomNotificationItem* item_; |
exo::NotificationSurface* const surface_; |
+ // A close button on top of NotificationSurface. Needed because the |
+ // aura::Window of NotificationSurface is added after hosting widget's |
+ // RootView thus standard notification close button is always below |
+ // it. |
+ std::unique_ptr<views::Widget> floating_close_button_widget_; |
+ |
+ views::ImageButton* floating_close_button_ = nullptr; |
+ |
DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationView); |
}; |