| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // Then destroy the children. | 255 // Then destroy the children. |
| 256 RemoveOrDestroyChildren(); | 256 RemoveOrDestroyChildren(); |
| 257 | 257 |
| 258 // The window needs to be removed from the parent before calling the | 258 // The window needs to be removed from the parent before calling the |
| 259 // WindowDestroyed callbacks of delegate and the observers. | 259 // WindowDestroyed callbacks of delegate and the observers. |
| 260 if (parent_) | 260 if (parent_) |
| 261 parent_->RemoveChild(this); | 261 parent_->RemoveChild(this); |
| 262 | 262 |
| 263 if (delegate_) | 263 if (delegate_) |
| 264 delegate_->OnWindowDestroyed(this); | 264 delegate_->OnWindowDestroyed(this); |
| 265 ObserverListBase<WindowObserver>::Iterator iter(observers_); | 265 ObserverListBase<WindowObserver>::Iterator iter(&observers_); |
| 266 for (WindowObserver* observer = iter.GetNext(); observer; | 266 for (WindowObserver* observer = iter.GetNext(); observer; |
| 267 observer = iter.GetNext()) { | 267 observer = iter.GetNext()) { |
| 268 RemoveObserver(observer); | 268 RemoveObserver(observer); |
| 269 observer->OnWindowDestroyed(this); | 269 observer->OnWindowDestroyed(this); |
| 270 } | 270 } |
| 271 | 271 |
| 272 // Clear properties. | 272 // Clear properties. |
| 273 for (std::map<const void*, Value>::const_iterator iter = prop_map_.begin(); | 273 for (std::map<const void*, Value>::const_iterator iter = prop_map_.begin(); |
| 274 iter != prop_map_.end(); | 274 iter != prop_map_.end(); |
| 275 ++iter) { | 275 ++iter) { |
| (...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1464 return window; | 1464 return window; |
| 1465 if (offset) | 1465 if (offset) |
| 1466 *offset += window->bounds().OffsetFromOrigin(); | 1466 *offset += window->bounds().OffsetFromOrigin(); |
| 1467 } | 1467 } |
| 1468 if (offset) | 1468 if (offset) |
| 1469 *offset = gfx::Vector2d(); | 1469 *offset = gfx::Vector2d(); |
| 1470 return NULL; | 1470 return NULL; |
| 1471 } | 1471 } |
| 1472 | 1472 |
| 1473 } // namespace aura | 1473 } // namespace aura |
| OLD | NEW |