summaryrefslogtreecommitdiffstats
path: root/ui/aura
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 05:10:59 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 05:10:59 +0000
commit3212d395332e1da75dc8624412303d6b15f9926b (patch)
tree9c7d1049d2198a2465474a91b69d7431dd245a83 /ui/aura
parent56b4dd97a2ff7472321696c2008ff9e578bddcb1 (diff)
downloadchromium_src-3212d395332e1da75dc8624412303d6b15f9926b.zip
chromium_src-3212d395332e1da75dc8624412303d6b15f9926b.tar.gz
chromium_src-3212d395332e1da75dc8624412303d6b15f9926b.tar.bz2
Revert 118057 - Add a simple animation when showing/hiding windows.
http://crbug.com/110024 TEST=none Review URL: http://codereview.chromium.org/9167032 TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/9249009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r--ui/aura/client/window_types.h11
-rw-r--r--ui/aura/window.cc19
-rw-r--r--ui/aura/window.h10
-rw-r--r--ui/aura/window_observer.h9
-rw-r--r--ui/aura/window_unittest.cc31
5 files changed, 8 insertions, 72 deletions
diff --git a/ui/aura/client/window_types.h b/ui/aura/client/window_types.h
index 9d8556d..9499313 100644
--- a/ui/aura/client/window_types.h
+++ b/ui/aura/client/window_types.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -18,15 +18,12 @@ enum WindowType {
// Regular windows that should be laid out by the client.
WINDOW_TYPE_NORMAL,
- // Miscellaneous windows that should not be laid out by the shell.
- WINDOW_TYPE_POPUP,
-
- // A window intended as a control. Not laid out by the shell.
- WINDOW_TYPE_CONTROL,
-
// Always on top windows aligned to bottom right of screen.
WINDOW_TYPE_PANEL,
+ // Miscellaneous windows that should not be laid out by the shell.
+ WINDOW_TYPE_POPUP,
+
WINDOW_TYPE_MENU,
WINDOW_TYPE_TOOLTIP,
};
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 7c2eeea..b0a1ed6 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -47,13 +47,9 @@ Window::Window(WindowDelegate* delegate)
}
Window::~Window() {
- if (layer_.get())
- layer_->set_delegate(NULL);
-
// Let the delegate know we're in the processing of destroying.
if (delegate_)
delegate_->OnWindowDestroying();
- FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroying(this));
// Let the root know so that it can remove any references to us.
RootWindow* root_window = GetRootWindow();
@@ -74,9 +70,6 @@ Window::~Window() {
transient_parent_->RemoveTransientChild(this);
// And let the delegate do any post cleanup.
- // TODO(beng): Figure out if this notification needs to happen here, or if it
- // can be moved down adjacent to the observer notification. If it has to be
- // done here, the reason why should be documented.
if (delegate_)
delegate_->OnWindowDestroyed();
if (parent_)
@@ -114,10 +107,6 @@ void Window::SetName(const std::string& name) {
UpdateLayerName(name_);
}
-ui::Layer* Window::AcquireLayer() {
- return layer_.release();
-}
-
void Window::Show() {
SetVisible(true);
}
@@ -263,9 +252,7 @@ void Window::RemoveChild(Window* child) {
child->parent_ = NULL;
if (root_window)
root_window->WindowDetachedFromRootWindow(child);
- // The child may have released its layer.
- if (child->layer_.get())
- layer_->Remove(child->layer_.get());
+ layer_->Remove(child->layer_.get());
children_.erase(i);
child->OnParentChanged();
}
@@ -485,9 +472,7 @@ void Window::SetBoundsInternal(const gfx::Rect& new_bounds) {
}
void Window::SetVisible(bool visible) {
- // TODO(beng): Replace this with layer_->GetTargetVisibility().
- // See http://crbug.com/110487
- if (visible == (layer_->visible() && layer_->GetTargetOpacity() != 0.0f))
+ if (visible == layer_->visible())
return; // No change.
bool was_visible = IsVisible();
diff --git a/ui/aura/window.h b/ui/aura/window.h
index 698c90e..73ba2dd 100644
--- a/ui/aura/window.h
+++ b/ui/aura/window.h
@@ -72,16 +72,6 @@ class AURA_EXPORT Window : public ui::LayerDelegate {
ui::Layer* layer() { return layer_.get(); }
const ui::Layer* layer() const { return layer_.get(); }
- // Releases the Window's 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 Window methods generally don't expect a NULL layer, and so this
- // function should only be called right before destroying the Window,
- // otherwise you will crash.
- ui::Layer* AcquireLayer();
-
WindowDelegate* delegate() { return delegate_; }
const gfx::Rect& bounds() const;
diff --git a/ui/aura/window_observer.h b/ui/aura/window_observer.h
index bd5138f..3aa0c14 100644
--- a/ui/aura/window_observer.h
+++ b/ui/aura/window_observer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -46,12 +46,7 @@ class AURA_EXPORT WindowObserver {
// has changed.
virtual void OnWindowStackingChanged(Window* window) {}
- // Invoked when the Window is being destroyed (i.e. from the start of its
- // destructor).
- virtual void OnWindowDestroying(Window* window) {}
-
- // Invoked when the Window has been destroyed (i.e. at the end of its
- // destructor).
+ // Invoked when the Window has been destroyed (i.e. from its destructor).
virtual void OnWindowDestroyed(Window* window) {}
protected:
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 58c23703..c6a5ff8 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -1038,36 +1038,5 @@ TEST_F(WindowObserverTest, PropertyChanged) {
EXPECT_EQ("name= old=0 new=0", PropertyChangeInfoAndClear());
}
-class LayerGrabber : public WindowObserver {
- public:
- explicit LayerGrabber(Window* window) {
- window->AddObserver(this);
- }
- virtual ~LayerGrabber() {}
-
- ui::Layer* layer() { return layer_.get(); }
-
- // Overridden from WindowObserver:
- virtual void OnWindowDestroying(Window* window) OVERRIDE {
- window->RemoveObserver(this);
- layer_.reset(window->AcquireLayer());
- }
-
- private:
- scoped_ptr<ui::Layer> layer_;
- DISALLOW_COPY_AND_ASSIGN(LayerGrabber);
-};
-
-TEST_F(WindowTest, AcquireLayer) {
- scoped_ptr<Window> window(CreateTestWindowWithId(1, NULL));
- window->Hide();
- LayerGrabber grabber(window.get());
- window.reset();
- EXPECT_FALSE(grabber.layer() == NULL);
- EXPECT_FALSE(grabber.layer()->visible());
- // This should be set by the window's destructor.
- EXPECT_TRUE(grabber.layer()->delegate() == NULL);
-}
-
} // namespace test
} // namespace aura