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 // TODO(skuhne): uncomment and fix issue 351553. | 342 DCHECK(!(visible_ && layer()->GetTargetOpacity() == 0.0f)); |
343 // DCHECK(!(visible_ && layer()->GetTargetOpacity() == 0.0f)); | |
344 } | 343 } |
345 SetVisible(true); | 344 SetVisible(true); |
346 } | 345 } |
347 | 346 |
348 void Window::Hide() { | 347 void Window::Hide() { |
349 // RootWindow::OnVisibilityChanged will call ReleaseCapture. | 348 // RootWindow::OnVisibilityChanged will call ReleaseCapture. |
350 SetVisible(false); | 349 SetVisible(false); |
351 } | 350 } |
352 | 351 |
353 bool Window::IsVisible() const { | 352 bool Window::IsVisible() const { |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 return window; | 1435 return window; |
1437 if (offset) | 1436 if (offset) |
1438 *offset += window->bounds().OffsetFromOrigin(); | 1437 *offset += window->bounds().OffsetFromOrigin(); |
1439 } | 1438 } |
1440 if (offset) | 1439 if (offset) |
1441 *offset = gfx::Vector2d(); | 1440 *offset = gfx::Vector2d(); |
1442 return NULL; | 1441 return NULL; |
1443 } | 1442 } |
1444 | 1443 |
1445 } // namespace aura | 1444 } // namespace aura |
OLD | NEW |