| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 const Window* root_window = GetRootWindow(); | 332 const Window* root_window = GetRootWindow(); |
| 333 return root_window ? root_window->host_ : NULL; | 333 return root_window ? root_window->host_ : NULL; |
| 334 } | 334 } |
| 335 | 335 |
| 336 void Window::Show() { | 336 void Window::Show() { |
| 337 if (layer()) { | 337 if (layer()) { |
| 338 DCHECK_EQ(visible_, layer()->GetTargetVisibility()); | 338 DCHECK_EQ(visible_, layer()->GetTargetVisibility()); |
| 339 // It is not allowed that a window is visible but the layers alpha is fully | 339 // It is not allowed that a window is visible but the layers alpha is fully |
| 340 // transparent since the window would still be considered to be active but | 340 // transparent since the window would still be considered to be active but |
| 341 // could not be seen. | 341 // could not be seen. |
| 342 DCHECK(!(visible_ && layer()->GetTargetOpacity() == 0.0f)); | 342 // TODO(skuhne): uncomment and fix issue 351553. |
| 343 // DCHECK(!(visible_ && layer()->GetTargetOpacity() == 0.0f)); |
| 343 } | 344 } |
| 344 SetVisible(true); | 345 SetVisible(true); |
| 345 } | 346 } |
| 346 | 347 |
| 347 void Window::Hide() { | 348 void Window::Hide() { |
| 348 // RootWindow::OnVisibilityChanged will call ReleaseCapture. | 349 // RootWindow::OnVisibilityChanged will call ReleaseCapture. |
| 349 SetVisible(false); | 350 SetVisible(false); |
| 350 } | 351 } |
| 351 | 352 |
| 352 bool Window::IsVisible() const { | 353 bool Window::IsVisible() const { |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 return window; | 1436 return window; |
| 1436 if (offset) | 1437 if (offset) |
| 1437 *offset += window->bounds().OffsetFromOrigin(); | 1438 *offset += window->bounds().OffsetFromOrigin(); |
| 1438 } | 1439 } |
| 1439 if (offset) | 1440 if (offset) |
| 1440 *offset = gfx::Vector2d(); | 1441 *offset = gfx::Vector2d(); |
| 1441 return NULL; | 1442 return NULL; |
| 1442 } | 1443 } |
| 1443 | 1444 |
| 1444 } // namespace aura | 1445 } // namespace aura |
| OLD | NEW |