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

Unified Diff: ui/aura/window.cc

Issue 10444014: ash: Improved window maximize/restore animations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix lock screen, app windows Created 8 years, 6 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/aura/window.h ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 0ae33789c847c238c27bdd156066a9d8f84ca4cd..82c442cfae8edf4a504b9422c0015f82940062ad 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -146,6 +146,33 @@ void Window::Init(ui::LayerType layer_type) {
Env::GetInstance()->NotifyWindowInitialized(this);
}
+ui::Layer* Window::RecreateLayer() {
+ // Disconnect the old layer, but don't delete it.
+ ui::Layer* old_layer = AcquireLayer();
+ old_layer->set_delegate(NULL);
+ layer_ = new ui::Layer(old_layer->type());
+ layer_owner_.reset(layer_);
+ layer_->SetVisible(old_layer->visible());
+ layer_->set_delegate(this);
+ UpdateLayerName(name_);
+ layer_->SetFillsBoundsOpaquely(!transparent_);
+ // Install new layer as a sibling of the old layer, stacked on top of it.
+ if (old_layer->parent()) {
+ old_layer->parent()->Add(layer_);
+ old_layer->parent()->StackAbove(layer_, old_layer);
+ }
+ // Migrate all the child layers over to the new layer. Copy the list because
+ // the items are removed during iteration.
+ std::vector<ui::Layer*> children_copy = old_layer->children();
+ for (std::vector<ui::Layer*>::const_iterator it = children_copy.begin();
+ it != children_copy.end();
+ ++it) {
+ ui::Layer* child = *it;
+ layer_->Add(child);
+ }
+ return old_layer;
+}
+
void Window::SetType(client::WindowType type) {
// Cannot change type after the window is initialized.
DCHECK(!layer());
« no previous file with comments | « ui/aura/window.h ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698