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

Unified Diff: ui/arc/notification/arc_custom_notification_item.cc

Issue 2668583005: Not Remove Non-Closable Arc Popup When Close Button is Pressed (Closed)
Patch Set: Created 3 years, 10 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
Index: ui/arc/notification/arc_custom_notification_item.cc
diff --git a/ui/arc/notification/arc_custom_notification_item.cc b/ui/arc/notification/arc_custom_notification_item.cc
index 827e8cb64b0d3606f361e30a20c9d9d220ec3cf9..3779ee1a4c625c87695683ead20e56e6c17e9490 100644
--- a/ui/arc/notification/arc_custom_notification_item.cc
+++ b/ui/arc/notification/arc_custom_notification_item.cc
@@ -25,7 +25,9 @@ constexpr char kNotifierId[] = "ARC_NOTIFICATION";
class ArcNotificationDelegate : public message_center::NotificationDelegate {
public:
explicit ArcNotificationDelegate(ArcCustomNotificationItem* item)
- : item_(item) {}
+ : item_(item) {
+ DCHECK(item_);
+ }
std::unique_ptr<message_center::CustomContent> CreateCustomContent()
override {
@@ -35,6 +37,8 @@ class ArcNotificationDelegate : public message_center::NotificationDelegate {
std::move(view), std::move(content_view_delegate));
}
+ void Close(bool by_user) override { item_->Close(by_user); }
+
private:
// The destructor is private since this class is ref-counted.
~ArcNotificationDelegate() override {}
@@ -107,13 +111,6 @@ void ArcCustomNotificationItem::UpdateWithArcNotificationData(
AddToMessageCenter();
}
-void ArcCustomNotificationItem::CloseFromCloseButton() {
- // Needs to manually remove notification from MessageCenter because
- // the floating close button is not part of MessageCenter.
- message_center()->RemoveNotification(notification_id(), true);
- Close(true);
-}
-
void ArcCustomNotificationItem::AddObserver(Observer* observer) {
observers_.AddObserver(observer);
}

Powered by Google App Engine
This is Rietveld 408576698