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

Unified Diff: ui/views/corewm/window_animations.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/DEPS ('k') | ui/views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/window_animations.cc
diff --git a/ui/views/corewm/window_animations.cc b/ui/views/corewm/window_animations.cc
index 4eb2caeceaf1ad2054890b00bd36f4a765c35840..42b26413129abdd166b339cd15de902c2393946e 100644
--- a/ui/views/corewm/window_animations.cc
+++ b/ui/views/corewm/window_animations.cc
@@ -35,8 +35,6 @@
#include "ui/gfx/vector3d_f.h"
#include "ui/views/corewm/corewm_switches.h"
#include "ui/views/corewm/window_util.h"
-#include "ui/views/view.h"
-#include "ui/views/widget/widget.h"
DECLARE_WINDOW_PROPERTY_TYPE(int)
DECLARE_WINDOW_PROPERTY_TYPE(views::corewm::WindowVisibilityAnimationType)
@@ -150,38 +148,20 @@ class HidingWindowAnimationObserver : public ui::ImplicitAnimationObserver,
virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {
DCHECK_EQ(window, window_);
DCHECK(layers_.empty());
- AcquireAllLayers(window_);
-
- // If the Widget has views with layers, then it is necessary to take
- // ownership of those layers too.
- views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window_);
- const views::Widget* const_widget = widget;
- if (widget && const_widget->GetRootView() && widget->GetContentsView())
- AcquireAllViewLayers(widget->GetContentsView());
+ AcquireAllLayers(window_->layer());
window_->RemoveObserver(this);
window_ = NULL;
}
- void AcquireAllLayers(aura::Window* window) {
- ui::Layer* layer = window->AcquireLayer();
- DCHECK(layer);
- layers_.push_back(layer);
- for (aura::Window::Windows::const_iterator it = window->children().begin();
- it != window->children().end();
- ++it)
- AcquireAllLayers(*it);
- }
-
- void AcquireAllViewLayers(views::View* view) {
- for (int i = 0; i < view->child_count(); ++i)
- AcquireAllViewLayers(view->child_at(i));
- if (view->layer()) {
- ui::Layer* layer = view->RecreateLayer();
- if (layer) {
- layer->SuppressPaint();
- layers_.push_back(layer);
- }
+ void AcquireAllLayers(ui::Layer* layer) {
+ if (layer->owner()) {
+ ui::Layer* released = layer->owner()->AcquireLayer();
+ DCHECK_EQ(layer, released);
+ layers_.push_back(released);
}
+ std::vector<Layer*>::const_iterator it = layer->children().begin();
+ for (; it != layer->children().end(); ++it)
+ AcquireAllLayers(*it);
}
aura::Window* window_;
« no previous file with comments | « ui/views/corewm/DEPS ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698