Index: ui/aura/window.cc |
=================================================================== |
--- ui/aura/window.cc (revision 114098) |
+++ ui/aura/window.cc (working copy) |
@@ -103,6 +103,10 @@ |
void Window::Hide() { |
SetVisible(false); |
ReleaseCapture(); |
+ if (RootWindow::GetInstance()->active_window() == this || |
+ !RootWindow::GetInstance()->active_window()) { |
+ RootWindow::GetInstance()->ActivateTopmostWindow(); |
+ } |
} |
bool Window::IsVisible() const { |
@@ -117,6 +121,19 @@ |
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); |
} |
@@ -202,6 +219,10 @@ |
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()); |