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

Side by Side Diff: ui/aura/window_destruction_observer.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/window.cc ('k') | ui/aura/window_destruction_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_AURA_WINDOW_DESTRUCTION_OBSERVER_H_
6 #define UI_AURA_WINDOW_DESTRUCTION_OBSERVER_H_
7
8 #include <set>
9
10 #include "ui/aura/aura_export.h"
11 #include "ui/aura/window.h"
12 #include "ui/aura/window_observer.h"
13
14 namespace aura {
15
16 // A class for observing window (self) destruction. A side effect of a
17 // window member funtion may be that the object, i.e. |this|, gets
18 // deleted. This class can be used to detect such cases and to exit
19 // the member function without any further access to member data. See
20 // for example: aura::Window::NotifyWindowVisibilityChangedAtReceiver.
21
22 class AURA_EXPORT WindowDestructionObserver : public WindowObserver {
23 public:
24 // Addes this observer to window.
25 explicit WindowDestructionObserver(aura::Window* window);
26
27 // Removes this observer from |window_| unless |window_| has been
28 // observed to be destroyed.
29 virtual ~WindowDestructionObserver();
30
31 // Returns true if |window_| has been observed to be destroyed.
32 bool destroyed() const { return destroyed_; }
33
34 private:
35 // aura::WindowObserver overrides:
36 virtual void OnWindowDestroyed(Window* window) OVERRIDE;
37
38 Window* window_;
39 bool destroyed_;
40
41 DISALLOW_COPY_AND_ASSIGN(WindowDestructionObserver);
42 };
43
44 } // namespace aura
45
46 #endif
OLDNEW
« no previous file with comments | « ui/aura/window.cc ('k') | ui/aura/window_destruction_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698