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

Unified Diff: ui/aura/window.cc

Issue 8082017: Change Window visibility to a simple boolean for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | « ui/aura/window.h ('k') | ui/aura/window_unittest.cc » ('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 103502)
+++ ui/aura/window.cc (working copy)
@@ -24,7 +24,7 @@
Window::Window(WindowDelegate* delegate)
: delegate_(delegate),
- visibility_(VISIBILITY_HIDDEN),
+ visible_(false),
parent_(NULL),
id_(-1),
user_data_(NULL) {
@@ -63,19 +63,15 @@
layer_->set_delegate(this);
}
-void Window::SetVisibility(Visibility visibility) {
- if (visibility_ == visibility)
- return;
+void Window::Show() {
+ SetVisible(true);
+}
- visibility_ = visibility;
- layer_->SetVisible(visibility_ != VISIBILITY_HIDDEN);
- SchedulePaint();
- if (visibility_ != VISIBILITY_SHOWN)
- ReleaseCapture();
- if ((visibility_ == VISIBILITY_HIDDEN &&
- Desktop::GetInstance()->active_window() == this) ||
- (visibility_ == VISIBILITY_HIDDEN &&
- !Desktop::GetInstance()->active_window())) {
+void Window::Hide() {
+ SetVisible(false);
+ ReleaseCapture();
+ if (Desktop::GetInstance()->active_window() == this ||
+ !Desktop::GetInstance()->active_window()) {
Desktop::GetInstance()->ActivateTopmostWindow();
}
}
@@ -205,7 +201,7 @@
Windows::const_reverse_iterator i = children_.rbegin();
for (; i != children_.rend(); ++i) {
Window* child = *i;
- if (child->visibility() == Window::VISIBILITY_HIDDEN)
+ if (!child->visible())
continue;
gfx::Point point_in_child_coords(point);
Window::ConvertPointToWindow(this, child, &point_in_child_coords);
@@ -223,7 +219,7 @@
}
void Window::SetCapture() {
- if (visibility_ != VISIBILITY_SHOWN)
+ if (!visible_)
return;
RootWindow* root = GetRoot();
@@ -259,6 +255,15 @@
return parent_ ? parent_->GetRoot() : NULL;
}
+void Window::SetVisible(bool visible) {
+ if (visible_ == visible)
+ return;
+
+ visible_ = visible;
+ layer_->SetVisible(visible_);
+ SchedulePaint();
+}
+
void Window::SchedulePaint() {
SchedulePaintInRect(gfx::Rect(0, 0, bounds().width(), bounds().height()));
}
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698