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

Side by Side Diff: ui/aura/window.cc

Issue 8570011: Aura: windows in aura should honor Widget::InitParams::accept_events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698