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

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

Issue 2751353002: Not Remove Non-Closable Arc Popup When Close Button is Pressed (Closed)
Patch Set: Created 3 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 | « no previous file | 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_item.cc
diff --git a/ui/arc/notification/arc_custom_notification_item.cc b/ui/arc/notification/arc_custom_notification_item.cc
index 54b194baa293e0ad2a7bdd027675454457683c27..d3cac1be5ba34295277ec51d626380da325f475e 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 {}
@@ -109,13 +113,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);
}
« no previous file with comments | « no previous file | ui/arc/notification/arc_custom_notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698