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

Side by Side Diff: ui/compositor/layer_owner.cc

Issue 2383263002: Generalize layer mirroring for phantom windows (Closed)
Patch Set: Created 4 years, 2 months 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
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698