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