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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
480 void Window::RemoveObserver(WindowObserver* observer) { | 480 void Window::RemoveObserver(WindowObserver* observer) { |
481 observers_.RemoveObserver(observer); | 481 observers_.RemoveObserver(observer); |
482 } | 482 } |
483 | 483 |
484 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) { | 484 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) { |
485 Window* root_window = GetRootWindow(); | 485 Window* root_window = GetRootWindow(); |
486 if (!root_window) | 486 if (!root_window) |
487 return false; | 487 return false; |
488 gfx::Point local_point(point_in_root); | 488 gfx::Point local_point(point_in_root); |
489 ConvertPointToWindow(root_window, this, &local_point); | 489 ConvertPointToWindow(root_window, this, &local_point); |
490 return GetTargetBounds().Contains(local_point); | 490 return gfx::Rect(gfx::Point(), |
491 GetTargetBounds().size()).Contains(local_point); | |
oshima
2012/07/21 13:25:04
gfx::Rect(GetTargetBounds().size()).Contains(local
Yusuke Sato
2012/07/23 16:39:42
Done.
| |
491 } | 492 } |
492 | 493 |
493 bool Window::ContainsPoint(const gfx::Point& local_point) { | 494 bool Window::ContainsPoint(const gfx::Point& local_point) { |
494 gfx::Rect local_bounds(gfx::Point(), bounds().size()); | 495 gfx::Rect local_bounds(gfx::Point(), bounds().size()); |
495 return local_bounds.Contains(local_point); | 496 return local_bounds.Contains(local_point); |
496 } | 497 } |
497 | 498 |
498 bool Window::HitTest(const gfx::Point& local_point) { | 499 bool Window::HitTest(const gfx::Point& local_point) { |
499 // Expand my bounds for hit testing (override is usually zero but it's | 500 // Expand my bounds for hit testing (override is usually zero but it's |
500 // probably cheaper to do the math every time than to branch). | 501 // probably cheaper to do the math every time than to branch). |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
947 for (Windows::const_reverse_iterator it = children_.rbegin(), | 948 for (Windows::const_reverse_iterator it = children_.rbegin(), |
948 rend = children_.rend(); | 949 rend = children_.rend(); |
949 it != rend; ++it) { | 950 it != rend; ++it) { |
950 Window* child = *it; | 951 Window* child = *it; |
951 child->PrintWindowHierarchy(depth + 1); | 952 child->PrintWindowHierarchy(depth + 1); |
952 } | 953 } |
953 } | 954 } |
954 #endif | 955 #endif |
955 | 956 |
956 } // namespace aura | 957 } // namespace aura |
OLD | NEW |