blob: bd1106aafdad099f479fcab894245c9945e039aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/aura/native_window_tracker_aura.h"
#include "ui/aura/window.h"
NativeWindowTrackerAura::NativeWindowTrackerAura(
gfx::NativeWindow window)
: window_(window) {
window->AddObserver(this);
}
NativeWindowTrackerAura::~NativeWindowTrackerAura() {
if (window_)
window_->RemoveObserver(this);
}
bool NativeWindowTrackerAura::WasNativeWindowClosed() const {
return window_ == nullptr;
}
void NativeWindowTrackerAura::OnWindowDestroying(
aura::Window* window) {
window_->RemoveObserver(this);
window_ = nullptr;
}
// static
scoped_ptr<NativeWindowTracker> NativeWindowTracker::Create(
gfx::NativeWindow window) {
return scoped_ptr<NativeWindowTracker>(new NativeWindowTrackerAura(window));
}
|