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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 } | 616 } |
617 | 617 |
618 void Window::MoveCursorTo(const gfx::Point& point_in_window) { | 618 void Window::MoveCursorTo(const gfx::Point& point_in_window) { |
619 Window* root_window = GetRootWindow(); | 619 Window* root_window = GetRootWindow(); |
620 DCHECK(root_window); | 620 DCHECK(root_window); |
621 gfx::Point point_in_root(point_in_window); | 621 gfx::Point point_in_root(point_in_window); |
622 ConvertPointToTarget(this, root_window, &point_in_root); | 622 ConvertPointToTarget(this, root_window, &point_in_root); |
623 root_window->GetHost()->MoveCursorTo(point_in_root); | 623 root_window->GetHost()->MoveCursorTo(point_in_root); |
624 } | 624 } |
625 | 625 |
626 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const { | |
627 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor; | |
628 } | |
629 | |
630 void Window::SetEventFilter(ui::EventHandler* event_filter) { | 626 void Window::SetEventFilter(ui::EventHandler* event_filter) { |
631 if (event_filter_) | 627 if (event_filter_) |
632 RemovePreTargetHandler(event_filter_.get()); | 628 RemovePreTargetHandler(event_filter_.get()); |
633 event_filter_.reset(event_filter); | 629 event_filter_.reset(event_filter); |
634 if (event_filter) | 630 if (event_filter) |
635 AddPreTargetHandler(event_filter); | 631 AddPreTargetHandler(event_filter); |
636 } | 632 } |
637 | 633 |
638 void Window::AddObserver(WindowObserver* observer) { | 634 void Window::AddObserver(WindowObserver* observer) { |
639 observers_.AddObserver(observer); | 635 observers_.AddObserver(observer); |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 return window; | 1422 return window; |
1427 if (offset) | 1423 if (offset) |
1428 *offset += window->bounds().OffsetFromOrigin(); | 1424 *offset += window->bounds().OffsetFromOrigin(); |
1429 } | 1425 } |
1430 if (offset) | 1426 if (offset) |
1431 *offset = gfx::Vector2d(); | 1427 *offset = gfx::Vector2d(); |
1432 return NULL; | 1428 return NULL; |
1433 } | 1429 } |
1434 | 1430 |
1435 } // namespace aura | 1431 } // namespace aura |
OLD | NEW |