| Index: ui/aura/test/test_window_delegate.cc
|
| diff --git a/ui/aura/test/test_window_delegate.cc b/ui/aura/test/test_window_delegate.cc
|
| index 0c11ba4a7eb1bd6c5cf2d4c56decff1931dfd94d..5ff1599263e9f0144e41a01a82038964a8b78279 100644
|
| --- a/ui/aura/test/test_window_delegate.cc
|
| +++ b/ui/aura/test/test_window_delegate.cc
|
| @@ -18,12 +18,21 @@ namespace test {
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // TestWindowDelegate
|
|
|
| -TestWindowDelegate::TestWindowDelegate() : window_component_(HTCLIENT) {
|
| +TestWindowDelegate::TestWindowDelegate()
|
| + : window_component_(HTCLIENT),
|
| + delete_on_destroyed_(false) {
|
| }
|
|
|
| TestWindowDelegate::~TestWindowDelegate() {
|
| }
|
|
|
| +// static
|
| +TestWindowDelegate* TestWindowDelegate::CreateSelfDestroyingDelegate() {
|
| + TestWindowDelegate* delegate = new TestWindowDelegate;
|
| + delegate->delete_on_destroyed_ = true;
|
| + return delegate;
|
| +}
|
| +
|
| gfx::Size TestWindowDelegate::GetMinimumSize() const {
|
| return gfx::Size();
|
| }
|
| @@ -87,6 +96,8 @@ void TestWindowDelegate::OnWindowDestroying() {
|
| }
|
|
|
| void TestWindowDelegate::OnWindowDestroyed() {
|
| + if (delete_on_destroyed_)
|
| + delete this;
|
| }
|
|
|
| void TestWindowDelegate::OnWindowTargetVisibilityChanged(bool visible) {
|
|
|