Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1180)

Side by Side Diff: ui/aura/window.cc

Issue 8574033: Beginnings of Window Modality support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 delete child; 49 delete child;
50 // Deleting the child so remove it from out children_ list. 50 // Deleting the child so remove it from out children_ list.
51 DCHECK(std::find(children_.begin(), children_.end(), child) == 51 DCHECK(std::find(children_.begin(), children_.end(), child) ==
52 children_.end()); 52 children_.end());
53 } 53 }
54 54
55 // Removes ourselves from our transient parent. 55 // Removes ourselves from our transient parent.
56 if (transient_parent_) 56 if (transient_parent_)
57 transient_parent_->RemoveTransientChild(this); 57 transient_parent_->RemoveTransientChild(this);
58 58
59 // Destroy transient children.
60 Windows transient_children(transient_children_);
61 STLDeleteElements(&transient_children);
62 DCHECK(transient_children_.empty());
63
64 // And let the delegate do any post cleanup. 59 // And let the delegate do any post cleanup.
65 if (delegate_) 60 if (delegate_)
66 delegate_->OnWindowDestroyed(); 61 delegate_->OnWindowDestroyed();
67 if (parent_) 62 if (parent_)
68 parent_->RemoveChild(this); 63 parent_->RemoveChild(this);
69 64
65 // Destroy transient children, only after we've removed ourselves from our
66 // parent, as destroying an active transient child may otherwise attempt to
67 // refocus us.
68 Windows transient_children(transient_children_);
69 STLDeleteElements(&transient_children);
70 DCHECK(transient_children_.empty());
71
70 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroyed(this)); 72 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroyed(this));
71 } 73 }
72 74
73 void Window::Init(ui::Layer::LayerType layer_type) { 75 void Window::Init(ui::Layer::LayerType layer_type) {
74 layer_.reset(new ui::Layer(layer_type)); 76 layer_.reset(new ui::Layer(layer_type));
75 layer_->SetVisible(false); 77 layer_->SetVisible(false);
76 layer_->set_delegate(this); 78 layer_->set_delegate(this);
77 } 79 }
78 80
79 void Window::SetType(WindowType type) { 81 void Window::SetType(WindowType type) {
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 491
490 return delegate_ ? this : NULL; 492 return delegate_ ? this : NULL;
491 } 493 }
492 494
493 void Window::OnPaintLayer(gfx::Canvas* canvas) { 495 void Window::OnPaintLayer(gfx::Canvas* canvas) {
494 if (delegate_) 496 if (delegate_)
495 delegate_->OnPaint(canvas); 497 delegate_->OnPaint(canvas);
496 } 498 }
497 499
498 } // namespace aura 500 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698