Chromium Code Reviews| Index: ui/aura/window_observer.cc |
| diff --git a/ui/aura/window_observer.cc b/ui/aura/window_observer.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..90cae2c6c73ff2ad7e75d3de146b52a1130ab7d7 |
| --- /dev/null |
| +++ b/ui/aura/window_observer.cc |
| @@ -0,0 +1,32 @@ |
| +// Copyright (c) 2013 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 "ui/aura/window_observer.h" |
| + |
| +#include "base/debug/stack_trace.h" |
|
flackr
2014/04/28 17:11:42
This doesn't seem to be used.
sky
2014/04/28 17:18:36
Done.
|
| +#include "base/logging.h" |
| +#include "ui/aura/window.h" |
| + |
| +namespace aura { |
| + |
| +WindowObserver::WindowObserver() : observing_(0) { |
| +} |
| + |
| +WindowObserver::~WindowObserver() { |
| + // TODO(flackr): Remove this check and observing_ counter when the cause of |
| + // http://crbug.com/365364 is discovered. |
| + CHECK_EQ(0, observing_); |
| +} |
| + |
| +void WindowObserver::OnObservingWindow(aura::Window* window) { |
| + if (!window->HasObserver(this)) |
| + observing_++; |
| +} |
| + |
| +void WindowObserver::OnUnobservingWindow(aura::Window* window) { |
| + if (window->HasObserver(this)) |
| + observing_--; |
| +} |
| + |
| +} // namespace aura |