| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/display/cursor_window_controller.h" | 5 #include "ash/display/cursor_window_controller.h" |
| 6 | 6 |
| 7 #include "ash/display/mirror_window_controller.h" | 7 #include "ash/display/mirror_window_controller.h" |
| 8 #include "ash/display/window_tree_host_manager.h" | 8 #include "ash/display/window_tree_host_manager.h" |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 SetBoundsInScreen(display.bounds()); | 143 SetBoundsInScreen(display.bounds()); |
| 144 // Updates the hot point based on the current display. | 144 // Updates the hot point based on the current display. |
| 145 UpdateCursorImage(); | 145 UpdateCursorImage(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void CursorWindowController::UpdateLocation() { | 148 void CursorWindowController::UpdateLocation() { |
| 149 if (!cursor_window_) | 149 if (!cursor_window_) |
| 150 return; | 150 return; |
| 151 gfx::Point point = aura::Env::GetInstance()->last_mouse_location(); | 151 gfx::Point point = aura::Env::GetInstance()->last_mouse_location(); |
| 152 if (!is_cursor_compositing_enabled_) { | 152 if (!is_cursor_compositing_enabled_) { |
| 153 Shell::GetPrimaryRootWindow()->GetHost()->ConvertPointToHost(&point); | 153 Shell::GetPrimaryRootWindow()->GetHost()->ConvertPointFromDIPToHost(&point); |
| 154 } else { | 154 } else { |
| 155 point.Offset(-bounds_in_screen_.x(), -bounds_in_screen_.y()); | 155 point.Offset(-bounds_in_screen_.x(), -bounds_in_screen_.y()); |
| 156 } | 156 } |
| 157 point.Offset(-hot_point_.x(), -hot_point_.y()); | 157 point.Offset(-hot_point_.x(), -hot_point_.y()); |
| 158 gfx::Rect bounds = cursor_window_->bounds(); | 158 gfx::Rect bounds = cursor_window_->bounds(); |
| 159 bounds.set_origin(point); | 159 bounds.set_origin(point); |
| 160 cursor_window_->SetBounds(bounds); | 160 cursor_window_->SetBounds(bounds); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void CursorWindowController::SetCursor(gfx::NativeCursor cursor) { | 163 void CursorWindowController::SetCursor(gfx::NativeCursor cursor) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 cursor_window_->Show(); | 282 cursor_window_->Show(); |
| 283 else | 283 else |
| 284 cursor_window_->Hide(); | 284 cursor_window_->Hide(); |
| 285 } | 285 } |
| 286 | 286 |
| 287 const gfx::ImageSkia& CursorWindowController::GetCursorImageForTest() const { | 287 const gfx::ImageSkia& CursorWindowController::GetCursorImageForTest() const { |
| 288 return delegate_->cursor_image(); | 288 return delegate_->cursor_image(); |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace ash | 291 } // namespace ash |
| OLD | NEW |