OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 bool Window::IsVisible() const { | 230 bool Window::IsVisible() const { |
231 // Layer visibility can be inconsistent with window visibility, for example | 231 // Layer visibility can be inconsistent with window visibility, for example |
232 // when a Window is hidden, we want this function to return false immediately | 232 // when a Window is hidden, we want this function to return false immediately |
233 // after, even though the client may decide to animate the hide effect (and | 233 // after, even though the client may decide to animate the hide effect (and |
234 // so the layer will be visible for some time after Hide() is called). | 234 // so the layer will be visible for some time after Hide() is called). |
235 return visible_ && layer_ && layer_->IsDrawn(); | 235 return visible_ && layer_ && layer_->IsDrawn(); |
236 } | 236 } |
237 | 237 |
238 gfx::Rect Window::GetBoundsInRootWindow() const { | 238 gfx::Rect Window::GetBoundsInRootWindow() const { |
239 // TODO(beng): There may be a better way to handle this, and the existing code | 239 // TODO(beng): There may be a better way to handle this, and the existing code |
240 // is likely wrong anyway in a multi-monitor world, but this will | 240 // is likely wrong anyway in a multi-display world, but this will |
241 // do for now. | 241 // do for now. |
242 if (!GetRootWindow()) | 242 if (!GetRootWindow()) |
243 return bounds(); | 243 return bounds(); |
244 gfx::Point origin = bounds().origin(); | 244 gfx::Point origin = bounds().origin(); |
245 Window::ConvertPointToWindow(parent_, GetRootWindow(), &origin); | 245 Window::ConvertPointToWindow(parent_, GetRootWindow(), &origin); |
246 return gfx::Rect(origin, bounds().size()); | 246 return gfx::Rect(origin, bounds().size()); |
247 } | 247 } |
248 | 248 |
249 void Window::SetTransform(const ui::Transform& transform) { | 249 void Window::SetTransform(const ui::Transform& transform) { |
250 RootWindow* root_window = GetRootWindow(); | 250 RootWindow* root_window = GetRootWindow(); |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 for (Windows::const_reverse_iterator it = children_.rbegin(), | 917 for (Windows::const_reverse_iterator it = children_.rbegin(), |
918 rend = children_.rend(); | 918 rend = children_.rend(); |
919 it != rend; ++it) { | 919 it != rend; ++it) { |
920 Window* child = *it; | 920 Window* child = *it; |
921 child->PrintWindowHierarchy(depth + 1); | 921 child->PrintWindowHierarchy(depth + 1); |
922 } | 922 } |
923 } | 923 } |
924 #endif | 924 #endif |
925 | 925 |
926 } // namespace aura | 926 } // namespace aura |
OLD | NEW |