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

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

Issue 2941703002: Detach notification surface (Closed)
Patch Set: Created 3 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/arc/notification/arc_notification_content_view.cc
diff --git a/ui/arc/notification/arc_notification_content_view.cc b/ui/arc/notification/arc_notification_content_view.cc
index 1c661aa204acdb122db99583c2a7373ba379b136..c55e22f0e0e94676fd308586bce5b8e2e96acf8a 100644
--- a/ui/arc/notification/arc_notification_content_view.cc
+++ b/ui/arc/notification/arc_notification_content_view.cc
@@ -360,6 +360,9 @@ void ArcNotificationContentView::SetSurface(exo::NotificationSurface* surface) {
if (surface_ && surface_->window()) {
surface_->window()->RemoveObserver(this);
surface_->window()->RemovePreTargetHandler(event_forwarder_.get());
+
+ if (GetWidget())
+ Detach();
}
surface_ = surface;
@@ -437,6 +440,8 @@ void ArcNotificationContentView::UpdateSnapshot() {
}
void ArcNotificationContentView::AttachSurface() {
+ DCHECK(!native_view());
+
if (!GetWidget())
return;
@@ -512,6 +517,8 @@ void ArcNotificationContentView::ViewHierarchyChanged(
if (!widget || !surface_ || !details.is_add)
return;
+ if (native_view())
+ Detach();
AttachSurface();
}
« 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