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

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, 11 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..9e8f9c073eea6f823dd9d662d10ee4a935c95e28 100644
--- a/ui/arc/notification/arc_custom_notification_item.cc
+++ b/ui/arc/notification/arc_custom_notification_item.cc
@@ -25,16 +25,20 @@ 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 {
- auto view = base::MakeUnique<ArcCustomNotificationView>(item_);
+ std::unique_ptr<message_center::CustomContent> CreateCustomContent(
+ message_center::MessageView* parent) override {
+ auto view = base::MakeUnique<ArcCustomNotificationView>(item_, parent);
auto content_view_delegate = view->CreateContentViewDelegate();
return base::MakeUnique<message_center::CustomContent>(
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
yoshiki 2017/02/06 22:22:22 This comment was wrong. We didn't need to call "Cl
- // 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