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

Side by Side Diff: ui/arc/notification/arc_custom_notification_view.cc

Issue 2825473002: ArcCustomNotificationView: Fix crash in onBlur (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/arc/notification/arc_custom_notification_view.h" 5 #include "ui/arc/notification/arc_custom_notification_view.h"
6 6
7 #include "ash/wm/window_util.h" 7 #include "ash/wm/window_util.h"
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "components/exo/notification_surface.h" 10 #include "components/exo/notification_surface.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 void ArcCustomNotificationView::OnFocus() { 527 void ArcCustomNotificationView::OnFocus() {
528 CHECK_EQ(message_center::CustomNotificationView::kViewClassName, 528 CHECK_EQ(message_center::CustomNotificationView::kViewClassName,
529 parent()->GetClassName()); 529 parent()->GetClassName());
530 530
531 NativeViewHost::OnFocus(); 531 NativeViewHost::OnFocus();
532 static_cast<message_center::CustomNotificationView*>(parent()) 532 static_cast<message_center::CustomNotificationView*>(parent())
533 ->OnContentFocused(); 533 ->OnContentFocused();
534 } 534 }
535 535
536 void ArcCustomNotificationView::OnBlur() { 536 void ArcCustomNotificationView::OnBlur() {
537 if (!parent()) {
538 // OnBlur may be called when this view is being removed.
539 return;
540 }
541
537 CHECK_EQ(message_center::CustomNotificationView::kViewClassName, 542 CHECK_EQ(message_center::CustomNotificationView::kViewClassName,
538 parent()->GetClassName()); 543 parent()->GetClassName());
539 544
540 NativeViewHost::OnBlur(); 545 NativeViewHost::OnBlur();
541 static_cast<message_center::CustomNotificationView*>(parent()) 546 static_cast<message_center::CustomNotificationView*>(parent())
542 ->OnContentBlured(); 547 ->OnContentBlured();
543 } 548 }
544 549
545 void ArcCustomNotificationView::ActivateToast() { 550 void ArcCustomNotificationView::ActivateToast() {
546 if (message_center::ToastContentsView::kViewClassName == 551 if (message_center::ToastContentsView::kViewClassName ==
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 632
628 void ArcCustomNotificationView::OnNotificationSurfaceRemoved( 633 void ArcCustomNotificationView::OnNotificationSurfaceRemoved(
629 exo::NotificationSurface* surface) { 634 exo::NotificationSurface* surface) {
630 if (surface->notification_id() != notification_key_) 635 if (surface->notification_id() != notification_key_)
631 return; 636 return;
632 637
633 SetSurface(nullptr); 638 SetSurface(nullptr);
634 } 639 }
635 640
636 } // namespace arc 641 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698