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

Unified Diff: ui/views/view.cc

Issue 184983005: Remove Views dependency from window_animations.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/corewm/window_animations.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 0ce6c97a158d0eacc864db812c45e3100d45e964..40ac67ba1e361b249ac2b907e5896c1b65e3b38f 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -519,13 +519,13 @@ void View::SetPaintToLayer(bool paint_to_layer) {
}
ui::Layer* View::RecreateLayer() {
- ui::Layer* layer = AcquireLayer();
- if (!layer)
+ ui::Layer* acquired = AcquireLayer();
+ if (!acquired)
return NULL;
CreateLayer();
- layer_->set_scale_content(layer->scale_content());
- return layer;
+ layer()->set_scale_content(acquired->scale_content());
+ return acquired;
}
// RTL positioning -------------------------------------------------------------
@@ -2098,11 +2098,10 @@ void View::CreateLayer() {
for (int i = 0, count = child_count(); i < count; ++i)
child_at(i)->UpdateChildLayerVisibility(true);
- layer_ = new ui::Layer();
- layer_owner_.reset(layer_);
- layer_->set_delegate(this);
+ SetLayer(new ui::Layer());
+ layer()->set_delegate(this);
#if !defined(NDEBUG)
- layer_->set_name(GetClassName());
+ layer()->set_name(GetClassName());
#endif
UpdateParentLayers();
@@ -2143,11 +2142,11 @@ void View::OrphanLayers() {
}
void View::ReparentLayer(const gfx::Vector2d& offset, ui::Layer* parent_layer) {
- layer_->SetBounds(GetLocalBounds() + offset);
+ layer()->SetBounds(GetLocalBounds() + offset);
DCHECK_NE(layer(), parent_layer);
if (parent_layer)
parent_layer->Add(layer());
- layer_->SchedulePaint(GetLocalBounds());
+ layer()->SchedulePaint(GetLocalBounds());
MoveLayerToParent(layer(), gfx::Point());
}
@@ -2160,8 +2159,7 @@ void View::DestroyLayer() {
new_parent->Add(children[i]);
}
- layer_ = NULL;
- layer_owner_.reset();
+ LayerOwner::DestroyLayer();
if (new_parent)
ReorderLayers();
« no previous file with comments | « ui/views/corewm/window_animations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698