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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 } | 490 } |
491 | 491 |
492 bool Window::ContainsPoint(const gfx::Point& local_point) const { | 492 bool Window::ContainsPoint(const gfx::Point& local_point) const { |
493 return gfx::Rect(bounds().size()).Contains(local_point); | 493 return gfx::Rect(bounds().size()).Contains(local_point); |
494 } | 494 } |
495 | 495 |
496 Window* Window::GetEventHandlerForPoint(const gfx::Point& local_point) { | 496 Window* Window::GetEventHandlerForPoint(const gfx::Point& local_point) { |
497 return GetWindowForPoint(local_point, true, true); | 497 return GetWindowForPoint(local_point, true, true); |
498 } | 498 } |
499 | 499 |
500 Window* Window::GetTopWindowContainingPoint(const gfx::Point& local_point) { | |
501 return GetWindowForPoint(local_point, false, false); | |
502 } | |
503 | |
504 Window* Window::GetToplevelWindow() { | 500 Window* Window::GetToplevelWindow() { |
505 // TODO: this may need to call to the WindowPort. For mus this may need to | 501 // TODO: this may need to call to the WindowPort. For mus this may need to |
506 // return for any top level. | 502 // return for any top level. |
507 Window* topmost_window_with_delegate = NULL; | 503 Window* topmost_window_with_delegate = NULL; |
508 for (aura::Window* window = this; window != NULL; window = window->parent()) { | 504 for (aura::Window* window = this; window != NULL; window = window->parent()) { |
509 if (window->delegate()) | 505 if (window->delegate()) |
510 topmost_window_with_delegate = window; | 506 topmost_window_with_delegate = window; |
511 } | 507 } |
512 return topmost_window_with_delegate; | 508 return topmost_window_with_delegate; |
513 } | 509 } |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 layer_name = "Unnamed Window"; | 1081 layer_name = "Unnamed Window"; |
1086 | 1082 |
1087 if (id_ != -1) | 1083 if (id_ != -1) |
1088 layer_name += " " + base::IntToString(id_); | 1084 layer_name += " " + base::IntToString(id_); |
1089 | 1085 |
1090 layer()->set_name(layer_name); | 1086 layer()->set_name(layer_name); |
1091 #endif | 1087 #endif |
1092 } | 1088 } |
1093 | 1089 |
1094 } // namespace aura | 1090 } // namespace aura |
OLD | NEW |