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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 gfx::Point point_in_root(point_in_window); | 629 gfx::Point point_in_root(point_in_window); |
630 ConvertPointToTarget(this, root_window, &point_in_root); | 630 ConvertPointToTarget(this, root_window, &point_in_root); |
631 root_window->GetHost()->MoveCursorTo(point_in_root); | 631 root_window->GetHost()->MoveCursorTo(point_in_root); |
632 } | 632 } |
633 | 633 |
634 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const { | 634 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const { |
635 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor; | 635 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor; |
636 } | 636 } |
637 | 637 |
638 void Window::AddObserver(WindowObserver* observer) { | 638 void Window::AddObserver(WindowObserver* observer) { |
| 639 observer->OnObservingWindow(this); |
639 observers_.AddObserver(observer); | 640 observers_.AddObserver(observer); |
640 } | 641 } |
641 | 642 |
642 void Window::RemoveObserver(WindowObserver* observer) { | 643 void Window::RemoveObserver(WindowObserver* observer) { |
| 644 observer->OnUnobservingWindow(this); |
643 observers_.RemoveObserver(observer); | 645 observers_.RemoveObserver(observer); |
644 } | 646 } |
645 | 647 |
646 bool Window::HasObserver(WindowObserver* observer) { | 648 bool Window::HasObserver(WindowObserver* observer) { |
647 return observers_.HasObserver(observer); | 649 return observers_.HasObserver(observer); |
648 } | 650 } |
649 | 651 |
650 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) const { | 652 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) const { |
651 const Window* root_window = GetRootWindow(); | 653 const Window* root_window = GetRootWindow(); |
652 if (!root_window) | 654 if (!root_window) |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1428 return window; | 1430 return window; |
1429 if (offset) | 1431 if (offset) |
1430 *offset += window->bounds().OffsetFromOrigin(); | 1432 *offset += window->bounds().OffsetFromOrigin(); |
1431 } | 1433 } |
1432 if (offset) | 1434 if (offset) |
1433 *offset = gfx::Vector2d(); | 1435 *offset = gfx::Vector2d(); |
1434 return NULL; | 1436 return NULL; |
1435 } | 1437 } |
1436 | 1438 |
1437 } // namespace aura | 1439 } // namespace aura |
OLD | NEW |