[Extensions] Make extension message bubble factory platform-abstract
[chromium-blink-merge.git] / chrome / browser / ui / aura / native_window_tracker_aura.cc
blobbd1106aafdad099f479fcab894245c9945e039aa
1 // Copyright 2014 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.
5 #include "chrome/browser/ui/aura/native_window_tracker_aura.h"
7 #include "ui/aura/window.h"
9 NativeWindowTrackerAura::NativeWindowTrackerAura(
10 gfx::NativeWindow window)
11 : window_(window) {
12 window->AddObserver(this);
15 NativeWindowTrackerAura::~NativeWindowTrackerAura() {
16 if (window_)
17 window_->RemoveObserver(this);
20 bool NativeWindowTrackerAura::WasNativeWindowClosed() const {
21 return window_ == nullptr;
24 void NativeWindowTrackerAura::OnWindowDestroying(
25 aura::Window* window) {
26 window_->RemoveObserver(this);
27 window_ = nullptr;
30 // static
31 scoped_ptr<NativeWindowTracker> NativeWindowTracker::Create(
32 gfx::NativeWindow window) {
33 return scoped_ptr<NativeWindowTracker>(new NativeWindowTrackerAura(window));