Chromium Code Reviews| 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/root_window.h" | 5 #include "ui/aura/root_window.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 // so just pass everything along to the host. | 210 // so just pass everything along to the host. |
| 211 host_->SetCursor(cursor); | 211 host_->SetCursor(cursor); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void RootWindow::ShowCursor(bool show) { | 214 void RootWindow::ShowCursor(bool show) { |
| 215 cursor_shown_ = show; | 215 cursor_shown_ = show; |
| 216 host_->ShowCursor(show); | 216 host_->ShowCursor(show); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void RootWindow::MoveCursorTo(const gfx::Point& location_in_dip) { | 219 void RootWindow::MoveCursorTo(const gfx::Point& location_in_dip) { |
| 220 host_->MoveCursorTo(ui::ConvertPointToPixel(layer(), location_in_dip)); | 220 gfx::Point location = location_in_dip; |
| 221 layer()->transform().TransformPoint(location); | |
| 222 host_->MoveCursorTo(ui::ConvertPointToPixel(layer(), location)); | |
| 223 last_mouse_location_ = location_in_dip; | |
| 221 } | 224 } |
| 222 | 225 |
| 223 bool RootWindow::ConfineCursorToWindow() { | 226 bool RootWindow::ConfineCursorToWindow() { |
| 224 // We would like to be able to confine the cursor to that window. However, | 227 // We would like to be able to confine the cursor to that window. However, |
| 225 // currently, we do not have such functionality in X. So we just confine | 228 // currently, we do not have such functionality in X. So we just confine |
| 226 // to the root window. This is ok because this option is currently only | 229 // to the root window. This is ok because this option is currently only |
| 227 // being used in fullscreen mode, so root_window bounds = window bounds. | 230 // being used in fullscreen mode, so root_window bounds = window bounds. |
| 228 return host_->ConfineCursorToRootWindow(); | 231 return host_->ConfineCursorToRootWindow(); |
| 229 } | 232 } |
| 230 | 233 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 644 } | 647 } |
| 645 | 648 |
| 646 void RootWindow::SetNativeCapture() { | 649 void RootWindow::SetNativeCapture() { |
| 647 host_->SetCapture(); | 650 host_->SetCapture(); |
| 648 } | 651 } |
| 649 | 652 |
| 650 void RootWindow::ReleaseNativeCapture() { | 653 void RootWindow::ReleaseNativeCapture() { |
| 651 host_->ReleaseCapture(); | 654 host_->ReleaseCapture(); |
| 652 } | 655 } |
| 653 | 656 |
| 654 //////////////////////////////////////////////////////////////////////////////// | 657 //////////////////////////////////////////////////////////////////////////////// |
|
Ben Goodger (Google)
2012/06/18 20:30:52
delete these two lines
| |
| 658 // RootWindow, for test purpose: | |
| 659 | |
| 660 gfx::Point RootWindow::QueryMouseLocationForTest() const { | |
| 661 return host_->QueryMouseLocation(); | |
| 662 } | |
| 663 | |
| 664 //////////////////////////////////////////////////////////////////////////////// | |
| 655 // RootWindow, private: | 665 // RootWindow, private: |
| 656 | 666 |
| 657 void RootWindow::HandleMouseMoved(const MouseEvent& event, Window* target) { | 667 void RootWindow::HandleMouseMoved(const MouseEvent& event, Window* target) { |
| 658 if (target == mouse_moved_handler_) | 668 if (target == mouse_moved_handler_) |
| 659 return; | 669 return; |
| 660 | 670 |
| 661 // Send an exited event. | 671 // Send an exited event. |
| 662 if (mouse_moved_handler_ && mouse_moved_handler_->delegate()) { | 672 if (mouse_moved_handler_ && mouse_moved_handler_->delegate()) { |
| 663 MouseEvent translated_event(event, this, mouse_moved_handler_, | 673 MouseEvent translated_event(event, this, mouse_moved_handler_, |
| 664 ui::ET_MOUSE_EXITED, event.flags()); | 674 ui::ET_MOUSE_EXITED, event.flags()); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1032 void RootWindow::UnlockCompositor() { | 1042 void RootWindow::UnlockCompositor() { |
| 1033 DCHECK(compositor_lock_); | 1043 DCHECK(compositor_lock_); |
| 1034 compositor_lock_ = NULL; | 1044 compositor_lock_ = NULL; |
| 1035 if (draw_on_compositor_unlock_) { | 1045 if (draw_on_compositor_unlock_) { |
| 1036 draw_on_compositor_unlock_ = false; | 1046 draw_on_compositor_unlock_ = false; |
| 1037 ScheduleDraw(); | 1047 ScheduleDraw(); |
| 1038 } | 1048 } |
| 1039 } | 1049 } |
| 1040 | 1050 |
| 1041 } // namespace aura | 1051 } // namespace aura |
| OLD | NEW |