| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 Window* Window::GetWindowForPoint(const gfx::Point& local_point, | 459 Window* Window::GetWindowForPoint(const gfx::Point& local_point, |
| 460 bool return_tightest, | 460 bool return_tightest, |
| 461 bool for_event_handling) { | 461 bool for_event_handling) { |
| 462 if (!IsVisible()) | 462 if (!IsVisible()) |
| 463 return NULL; | 463 return NULL; |
| 464 | 464 |
| 465 if ((for_event_handling && !HitTest(local_point)) || | 465 if ((for_event_handling && !HitTest(local_point)) || |
| 466 (!for_event_handling && !ContainsPoint(local_point))) | 466 (!for_event_handling && !ContainsPoint(local_point))) |
| 467 return NULL; | 467 return NULL; |
| 468 | 468 |
| 469 if (for_event_handling && delegate_ && !delegate_->ShouldAcceptEvents()) |
| 470 return NULL; |
| 471 |
| 469 if (!return_tightest && delegate_) | 472 if (!return_tightest && delegate_) |
| 470 return this; | 473 return this; |
| 471 | 474 |
| 472 for (Windows::const_reverse_iterator it = children_.rbegin(); | 475 for (Windows::const_reverse_iterator it = children_.rbegin(); |
| 473 it != children_.rend(); ++it) { | 476 it != children_.rend(); ++it) { |
| 474 Window* child = *it; | 477 Window* child = *it; |
| 475 if (!child->IsVisible()) | 478 if (!child->IsVisible()) |
| 476 continue; | 479 continue; |
| 477 | 480 |
| 478 gfx::Point point_in_child_coords(local_point); | 481 gfx::Point point_in_child_coords(local_point); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 489 | 492 |
| 490 return delegate_ ? this : NULL; | 493 return delegate_ ? this : NULL; |
| 491 } | 494 } |
| 492 | 495 |
| 493 void Window::OnPaintLayer(gfx::Canvas* canvas) { | 496 void Window::OnPaintLayer(gfx::Canvas* canvas) { |
| 494 if (delegate_) | 497 if (delegate_) |
| 495 delegate_->OnPaint(canvas); | 498 delegate_->OnPaint(canvas); |
| 496 } | 499 } |
| 497 | 500 |
| 498 } // namespace aura | 501 } // namespace aura |
| OLD | NEW |