| 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 void Window::AddObserver(WindowObserver* observer) { | 656 void Window::AddObserver(WindowObserver* observer) { |
| 657 observer->OnObservingWindow(this); | 657 observer->OnObservingWindow(this); |
| 658 observers_.AddObserver(observer); | 658 observers_.AddObserver(observer); |
| 659 } | 659 } |
| 660 | 660 |
| 661 void Window::RemoveObserver(WindowObserver* observer) { | 661 void Window::RemoveObserver(WindowObserver* observer) { |
| 662 observer->OnUnobservingWindow(this); | 662 observer->OnUnobservingWindow(this); |
| 663 observers_.RemoveObserver(observer); | 663 observers_.RemoveObserver(observer); |
| 664 } | 664 } |
| 665 | 665 |
| 666 bool Window::HasObserver(WindowObserver* observer) { | 666 bool Window::HasObserver(const WindowObserver* observer) const { |
| 667 return observers_.HasObserver(observer); | 667 return observers_.HasObserver(observer); |
| 668 } | 668 } |
| 669 | 669 |
| 670 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) const { | 670 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) const { |
| 671 const Window* root_window = GetRootWindow(); | 671 const Window* root_window = GetRootWindow(); |
| 672 if (!root_window) | 672 if (!root_window) |
| 673 return false; | 673 return false; |
| 674 gfx::Point local_point(point_in_root); | 674 gfx::Point local_point(point_in_root); |
| 675 ConvertPointToTarget(root_window, this, &local_point); | 675 ConvertPointToTarget(root_window, this, &local_point); |
| 676 return gfx::Rect(GetTargetBounds().size()).Contains(local_point); | 676 return gfx::Rect(GetTargetBounds().size()).Contains(local_point); |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 return window; | 1451 return window; |
| 1452 if (offset) | 1452 if (offset) |
| 1453 *offset += window->bounds().OffsetFromOrigin(); | 1453 *offset += window->bounds().OffsetFromOrigin(); |
| 1454 } | 1454 } |
| 1455 if (offset) | 1455 if (offset) |
| 1456 *offset = gfx::Vector2d(); | 1456 *offset = gfx::Vector2d(); |
| 1457 return NULL; | 1457 return NULL; |
| 1458 } | 1458 } |
| 1459 | 1459 |
| 1460 } // namespace aura | 1460 } // namespace aura |
| OLD | NEW |