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

Side by Side Diff: ui/aura/window_destruction_observer.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/window_destruction_observer.h ('k') | 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
(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 #include "ui/aura/window_destruction_observer.h"
6
7 namespace aura {
8
9 WindowDestructionObserver::WindowDestructionObserver(Window* window)
10 : window_(window), destroyed_(false) {
11 DCHECK(window_);
12 window_->AddObserver(this);
13 }
14
15 WindowDestructionObserver::~WindowDestructionObserver() {
16 if (!destroyed_)
17 window_->RemoveObserver(this);
18 }
19
20 void WindowDestructionObserver::OnWindowDestroyed(Window* window) {
21 if (window == window_)
22 destroyed_ = true;
23 }
24
25 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_destruction_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698