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/compositor/layer_owner.h" | 5 #include "ui/compositor/layer_owner.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "ui/compositor/layer_owner_delegate.h" | 10 #include "ui/compositor/layer_owner_delegate.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // Install the delegate last so that the delegate isn't notified as we copy | 80 // Install the delegate last so that the delegate isn't notified as we copy |
81 // state to the new layer. | 81 // state to the new layer. |
82 new_layer->set_delegate(old_delegate); | 82 new_layer->set_delegate(old_delegate); |
83 | 83 |
84 if (layer_owner_delegate_) | 84 if (layer_owner_delegate_) |
85 layer_owner_delegate_->OnLayerRecreated(old_layer.get(), new_layer); | 85 layer_owner_delegate_->OnLayerRecreated(old_layer.get(), new_layer); |
86 | 86 |
87 return old_layer; | 87 return old_layer; |
88 } | 88 } |
89 | 89 |
| 90 void LayerOwner::MirrorLayer(Layer* mirror) const { |
| 91 DCHECK(OwnsLayer()); |
| 92 layer_owner_delegate_->OnLayerMirrored(mirror); |
| 93 } |
| 94 |
90 void LayerOwner::DestroyLayer() { | 95 void LayerOwner::DestroyLayer() { |
91 layer_ = NULL; | 96 layer_ = NULL; |
92 layer_owner_.reset(); | 97 layer_owner_.reset(); |
93 } | 98 } |
94 | 99 |
95 bool LayerOwner::OwnsLayer() const { | 100 bool LayerOwner::OwnsLayer() const { |
96 return !!layer_owner_; | 101 return !!layer_owner_; |
97 } | 102 } |
98 | 103 |
99 } // namespace ui | 104 } // namespace ui |
OLD | NEW |