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

Unified Diff: ui/aura/window.h

Issue 10412044: layers: Consolidate the ownership of layers in views::View and aura::Window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « no previous file | ui/aura/window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.h
diff --git a/ui/aura/window.h b/ui/aura/window.h
index 382d5821e0b437b98ccaeaffc7e47f6999c4e91c..d280b0debbeb71e797d0d7c8bd5e742475a9a678 100644
--- a/ui/aura/window.h
+++ b/ui/aura/window.h
@@ -20,6 +20,7 @@
#include "ui/base/gestures/gesture_types.h"
#include "ui/compositor/layer_animator.h"
#include "ui/compositor/layer_delegate.h"
+#include "ui/compositor/layer_owner.h"
#include "ui/compositor/layer_type.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/native_widget_types.h"
@@ -53,6 +54,7 @@ struct WindowProperty;
// WindowDelegate.
// TODO(beng): resolve ownership.
class AURA_EXPORT Window : public ui::LayerDelegate,
+ public ui::LayerOwner,
public ui::GestureConsumer {
public:
typedef std::vector<Window*> Windows;
@@ -99,17 +101,6 @@ class AURA_EXPORT Window : public ui::LayerDelegate,
bool transparent() const { return transparent_; }
void SetTransparent(bool transparent);
- ui::Layer* layer() { return layer_; }
- const ui::Layer* layer() const { return layer_; }
-
- // Releases the Window's owning reference to its layer, and returns it.
- // This is used when you need to animate the presentation of the Window just
- // prior to destroying it. The window can be destroyed soon after calling this
- // function, and the caller is then responsible for disposing of the layer
- // once any animation completes. Note that layer() will remain valid until the
- // end of ~Window().
- ui::Layer* AcquireLayer();
-
WindowDelegate* delegate() { return delegate_; }
const gfx::Rect& bounds() const;
@@ -414,14 +405,6 @@ class AURA_EXPORT Window : public ui::LayerDelegate,
WindowDelegate* delegate_;
- // The Window will own its layer unless ownership is relinquished via a call
- // to AcquireLayer(). After that moment |layer_| will still be valid but
- // |layer_owner_| will be NULL. The reason for releasing ownership is that
- // the client may wish to animate the window's layer beyond the lifetime of
- // the window, e.g. fading it out when it is destroyed.
- scoped_ptr<ui::Layer> layer_owner_;
- ui::Layer* layer_;
-
// The Window's parent.
Window* parent_;
« no previous file with comments | « no previous file | ui/aura/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698