summaryrefslogtreecommitdiffstats
path: root/ui/aura/window.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-12 22:10:51 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-12 22:10:51 +0000
commit9b10d2a051ec36c4e7f012d31b8214221db16eaa (patch)
treeb6242231f0674978d51071f02f511c81370a022c /ui/aura/window.cc
parent178520e30cfa28c3e33dd24a1868a06332975de4 (diff)
downloadchromium_src-9b10d2a051ec36c4e7f012d31b8214221db16eaa.zip
chromium_src-9b10d2a051ec36c4e7f012d31b8214221db16eaa.tar.gz
chromium_src-9b10d2a051ec36c4e7f012d31b8214221db16eaa.tar.bz2
Move the concept of Activation to the Shell.
The Active Window is now stored in a property on the RootWindow. Classes wishing to observe changes to this can implement WindowObserver and attach to the RootWindow to be notified of changes in this property. We provide an ActivationClient interface in Aura for customers to use to set/get the active window, and deactivate a window. This is because setting the active window involves more than just changing the property, there is some additional book-keeping that must be done. The ActivationClient is stored in a property on the RootWindow. We also provide an ActivationDelegate interface in Aura that window owners can use to be notified of changes in activation state, and to specify whether or not a window can be activated. The ActivationDelegate should be stored on the relevant window in a property. I moved a lot of Activation-related functionality out of Aura, including all of the unit tests, now on ActivationController, and the associated WindowDelegate implementations which have now become a single TestActivationDelegate implementation. BUG=none TEST=unit tests Review URL: http://codereview.chromium.org/8894018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/window.cc')
-rw-r--r--ui/aura/window.cc21
1 files changed, 0 insertions, 21 deletions
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 74721fa..8a10667 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -103,10 +103,6 @@ void Window::Show() {
void Window::Hide() {
SetVisible(false);
ReleaseCapture();
- if (RootWindow::GetInstance()->active_window() == this ||
- !RootWindow::GetInstance()->active_window()) {
- RootWindow::GetInstance()->ActivateTopmostWindow();
- }
}
bool Window::IsVisible() const {
@@ -121,19 +117,6 @@ gfx::Rect Window::GetScreenBounds() const {
return gfx::Rect(origin, bounds().size());
}
-void Window::Activate() {
- // If we support minimization need to ensure this restores the window first.
- aura::RootWindow::GetInstance()->SetActiveWindow(this, this);
-}
-
-void Window::Deactivate() {
- aura::RootWindow::GetInstance()->Deactivate(this);
-}
-
-bool Window::IsActive() const {
- return aura::RootWindow::GetInstance()->active_window() == this;
-}
-
void Window::SetTransform(const ui::Transform& transform) {
layer()->SetTransform(transform);
}
@@ -219,10 +202,6 @@ void Window::StackChildAbove(Window* child, Window* other) {
child->OnStackingChanged();
}
-bool Window::CanActivate() const {
- return IsVisible() && (!delegate_ || delegate_->ShouldActivate(NULL));
-}
-
void Window::AddChild(Window* child) {
DCHECK(std::find(children_.begin(), children_.end(), child) ==
children_.end());