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/aura/window.cc

Issue 22254003: Nukes aura::WindowDestructionObserver. It's effectively the same as (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | « ui/aura/aura.gyp ('k') | ui/aura/window_destruction_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index e3960fc05d1ff3585a1bea06ab9266853a30d009..e5289e46a292980d4b5e795f4d8a925f99b7499b 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -23,8 +23,8 @@
#include "ui/aura/layout_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window_delegate.h"
-#include "ui/aura/window_destruction_observer.h"
#include "ui/aura/window_observer.h"
+#include "ui/aura/window_tracker.h"
#include "ui/base/animation/multi_animation.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/layer.h"
@@ -1027,13 +1027,14 @@ void Window::NotifyWindowVisibilityChanged(aura::Window* target,
bool Window::NotifyWindowVisibilityChangedAtReceiver(aura::Window* target,
bool visible) {
- // |this| may be deleted during a call to OnWindowVisibilityChanged
- // on one of the observers. We create an local observer for that. In
- // that case we exit without further access to any members.
- WindowDestructionObserver destruction_observer(this);
+ // |this| may be deleted during a call to OnWindowVisibilityChanged() on one
+ // of the observers. We create an local observer for that. In that case we
+ // exit without further access to any members.
+ WindowTracker tracker;
+ tracker.Add(this);
FOR_EACH_OBSERVER(WindowObserver, observers_,
OnWindowVisibilityChanged(target, visible));
- return !destruction_observer.destroyed();
+ return tracker.Contains(this);
}
bool Window::NotifyWindowVisibilityChangedDown(aura::Window* target,
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/window_destruction_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698