OLD | NEW |
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // And let the delegate do any post cleanup. | 64 // And let the delegate do any post cleanup. |
65 if (delegate_) | 65 if (delegate_) |
66 delegate_->OnWindowDestroyed(); | 66 delegate_->OnWindowDestroyed(); |
67 if (parent_) | 67 if (parent_) |
68 parent_->RemoveChild(this); | 68 parent_->RemoveChild(this); |
69 | 69 |
70 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroyed(this)); | 70 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroyed(this)); |
71 } | 71 } |
72 | 72 |
73 void Window::Init(ui::Layer::LayerType layer_type) { | 73 void Window::Init(ui::Layer::LayerType layer_type) { |
74 layer_.reset(new ui::Layer(Desktop::GetInstance()->compositor(), layer_type)); | 74 layer_.reset(new ui::Layer(layer_type)); |
75 layer_->SetVisible(false); | 75 layer_->SetVisible(false); |
76 layer_->set_delegate(this); | 76 layer_->set_delegate(this); |
77 } | 77 } |
78 | 78 |
79 void Window::SetType(WindowType type) { | 79 void Window::SetType(WindowType type) { |
80 // Cannot change type after the window is initialized. | 80 // Cannot change type after the window is initialized. |
81 DCHECK(!layer()); | 81 DCHECK(!layer()); |
82 type_ = type; | 82 type_ = type; |
83 } | 83 } |
84 | 84 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 | 489 |
490 return delegate_ ? this : NULL; | 490 return delegate_ ? this : NULL; |
491 } | 491 } |
492 | 492 |
493 void Window::OnPaintLayer(gfx::Canvas* canvas) { | 493 void Window::OnPaintLayer(gfx::Canvas* canvas) { |
494 if (delegate_) | 494 if (delegate_) |
495 delegate_->OnPaint(canvas); | 495 delegate_->OnPaint(canvas); |
496 } | 496 } |
497 | 497 |
498 } // namespace aura | 498 } // namespace aura |
OLD | NEW |