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

Unified Diff: ui/arc/notification/arc_custom_notification_view.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_view.cc
diff --git a/ui/arc/notification/arc_custom_notification_view.cc b/ui/arc/notification/arc_custom_notification_view.cc
index 71b8777a499c0049acdcf1185b6ab2d157d2d7ba..699a87360786363be7fbdab5a4d48456d3503e95 100644
--- a/ui/arc/notification/arc_custom_notification_view.cc
+++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -489,12 +489,18 @@ void ArcCustomNotificationView::OnFocus() {
}
void ArcCustomNotificationView::OnBlur() {
+ CHECK_EQ(message_center::CustomNotificationView::kViewClassName,
dewittj 2017/02/28 21:38:48 Unclear to me whether this should be CHECK or DCHE
yoshiki 2017/03/02 03:33:35 I'm adding a test, which checks CHECK for ButtonPr
+ parent()->GetClassName());
+
NativeViewHost::OnBlur();
static_cast<message_center::CustomNotificationView*>(parent())
->OnContentBlured();
}
views::FocusTraversable* ArcCustomNotificationView::GetFocusTraversable() {
+ CHECK_EQ(message_center::CustomNotificationView::kViewClassName,
dewittj 2017/02/28 21:38:48 this doesn't seem to be relevant here?
yoshiki 2017/03/02 03:33:35 Good catch. This should be in OnFocus() instead of
+ parent()->GetClassName());
+
if (floating_close_button_widget_)
return static_cast<views::internal::RootView*>(
floating_close_button_widget_->GetRootView());
@@ -503,8 +509,11 @@ views::FocusTraversable* ArcCustomNotificationView::GetFocusTraversable() {
void ArcCustomNotificationView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
+ CHECK_EQ(message_center::CustomNotificationView::kViewClassName,
+ parent()->GetClassName());
if (item_ && !item_->pinned() && sender == floating_close_button_) {
- item_->CloseFromCloseButton();
+ static_cast<message_center::CustomNotificationView*>(parent())
+ ->OnCloseButtonPressed();
}
}
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.h ('k') | ui/message_center/views/custom_notification_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698