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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 RemoveOrDestroyChildren(); | 250 RemoveOrDestroyChildren(); |
251 | 251 |
252 // The window needs to be removed from the parent before calling the | 252 // The window needs to be removed from the parent before calling the |
253 // WindowDestroyed callbacks of delegate and the observers. | 253 // WindowDestroyed callbacks of delegate and the observers. |
254 if (parent_) | 254 if (parent_) |
255 parent_->RemoveChild(this); | 255 parent_->RemoveChild(this); |
256 | 256 |
257 if (delegate_) | 257 if (delegate_) |
258 delegate_->OnWindowDestroyed(this); | 258 delegate_->OnWindowDestroyed(this); |
259 ObserverListBase<WindowObserver>::Iterator iter(observers_); | 259 ObserverListBase<WindowObserver>::Iterator iter(observers_); |
260 WindowObserver* observer; | 260 for (WindowObserver* observer = iter.GetNext(); observer; |
261 while ((observer = iter.GetNext())) { | 261 observer = iter.GetNext()) { |
262 RemoveObserver(observer); | 262 RemoveObserver(observer); |
263 observer->OnWindowDestroyed(this); | 263 observer->OnWindowDestroyed(this); |
264 } | 264 } |
265 | 265 |
266 // Clear properties. | 266 // Clear properties. |
267 for (std::map<const void*, Value>::const_iterator iter = prop_map_.begin(); | 267 for (std::map<const void*, Value>::const_iterator iter = prop_map_.begin(); |
268 iter != prop_map_.end(); | 268 iter != prop_map_.end(); |
269 ++iter) { | 269 ++iter) { |
270 if (iter->second.deallocator) | 270 if (iter->second.deallocator) |
271 (*iter->second.deallocator)(iter->second.value); | 271 (*iter->second.deallocator)(iter->second.value); |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 return window; | 1445 return window; |
1446 if (offset) | 1446 if (offset) |
1447 *offset += window->bounds().OffsetFromOrigin(); | 1447 *offset += window->bounds().OffsetFromOrigin(); |
1448 } | 1448 } |
1449 if (offset) | 1449 if (offset) |
1450 *offset = gfx::Vector2d(); | 1450 *offset = gfx::Vector2d(); |
1451 return NULL; | 1451 return NULL; |
1452 } | 1452 } |
1453 | 1453 |
1454 } // namespace aura | 1454 } // namespace aura |
OLD | NEW |