| 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); | |
| 640 observers_.AddObserver(observer); | 639 observers_.AddObserver(observer); |
| 641 } | 640 } |
| 642 | 641 |
| 643 void Window::RemoveObserver(WindowObserver* observer) { | 642 void Window::RemoveObserver(WindowObserver* observer) { |
| 644 observer->OnUnobservingWindow(this); | |
| 645 observers_.RemoveObserver(observer); | 643 observers_.RemoveObserver(observer); |
| 646 } | 644 } |
| 647 | 645 |
| 648 bool Window::HasObserver(WindowObserver* observer) { | 646 bool Window::HasObserver(WindowObserver* observer) { |
| 649 return observers_.HasObserver(observer); | 647 return observers_.HasObserver(observer); |
| 650 } | 648 } |
| 651 | 649 |
| 652 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) const { | 650 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) const { |
| 653 const Window* root_window = GetRootWindow(); | 651 const Window* root_window = GetRootWindow(); |
| 654 if (!root_window) | 652 if (!root_window) |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 return window; | 1428 return window; |
| 1431 if (offset) | 1429 if (offset) |
| 1432 *offset += window->bounds().OffsetFromOrigin(); | 1430 *offset += window->bounds().OffsetFromOrigin(); |
| 1433 } | 1431 } |
| 1434 if (offset) | 1432 if (offset) |
| 1435 *offset = gfx::Vector2d(); | 1433 *offset = gfx::Vector2d(); |
| 1436 return NULL; | 1434 return NULL; |
| 1437 } | 1435 } |
| 1438 | 1436 |
| 1439 } // namespace aura | 1437 } // namespace aura |
| OLD | NEW |