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

Unified Diff: ui/aura/window.cc

Issue 8926004: Revert 114095 - Move the concept of Activation to the Shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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/aura/window.h ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698