OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 ignore_events_(false), | 210 ignore_events_(false), |
211 // Don't notify newly added observers during notification. This causes | 211 // Don't notify newly added observers during notification. This causes |
212 // problems for code that adds an observer as part of an observer | 212 // problems for code that adds an observer as part of an observer |
213 // notification (such as the workspace code). | 213 // notification (such as the workspace code). |
214 observers_(ObserverList<WindowObserver>::NOTIFY_EXISTING_ONLY) { | 214 observers_(ObserverList<WindowObserver>::NOTIFY_EXISTING_ONLY) { |
215 set_target_handler(delegate_); | 215 set_target_handler(delegate_); |
216 } | 216 } |
217 | 217 |
218 Window::~Window() { | 218 Window::~Window() { |
219 // |layer()| can be NULL during tests, or if this Window is layerless. | 219 // |layer()| can be NULL during tests, or if this Window is layerless. |
220 if (layer()) | 220 if (layer()) { |
| 221 if (layer()->owner() == this) |
| 222 layer()->CompleteAllAnimations(); |
221 layer()->SuppressPaint(); | 223 layer()->SuppressPaint(); |
| 224 } |
222 | 225 |
223 // Let the delegate know we're in the processing of destroying. | 226 // Let the delegate know we're in the processing of destroying. |
224 if (delegate_) | 227 if (delegate_) |
225 delegate_->OnWindowDestroying(this); | 228 delegate_->OnWindowDestroying(this); |
226 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroying(this)); | 229 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroying(this)); |
227 | 230 |
228 // TODO(beng): See comment in window_event_dispatcher.h. This shouldn't be | 231 // TODO(beng): See comment in window_event_dispatcher.h. This shouldn't be |
229 // necessary but unfortunately is right now due to ordering | 232 // necessary but unfortunately is right now due to ordering |
230 // peculiarities. WED must be notified _after_ other observers | 233 // peculiarities. WED must be notified _after_ other observers |
231 // are notified of pending teardown but before the hierarchy | 234 // are notified of pending teardown but before the hierarchy |
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1428 return window; | 1431 return window; |
1429 if (offset) | 1432 if (offset) |
1430 *offset += window->bounds().OffsetFromOrigin(); | 1433 *offset += window->bounds().OffsetFromOrigin(); |
1431 } | 1434 } |
1432 if (offset) | 1435 if (offset) |
1433 *offset = gfx::Vector2d(); | 1436 *offset = gfx::Vector2d(); |
1434 return NULL; | 1437 return NULL; |
1435 } | 1438 } |
1436 | 1439 |
1437 } // namespace aura | 1440 } // namespace aura |
OLD | NEW |