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/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/display/mirror_window_controller.h" | 8 #include "ash/display/mirror_window_controller.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 kShellWindowId_OverlayContainer)); | 140 kShellWindowId_OverlayContainer)); |
141 SetBoundsInScreen(display.bounds()); | 141 SetBoundsInScreen(display.bounds()); |
142 } | 142 } |
143 | 143 |
144 void CursorWindowController::UpdateLocation() { | 144 void CursorWindowController::UpdateLocation() { |
145 if (!cursor_window_) | 145 if (!cursor_window_) |
146 return; | 146 return; |
147 | 147 |
148 gfx::Point point = aura::Env::GetInstance()->last_mouse_location(); | 148 gfx::Point point = aura::Env::GetInstance()->last_mouse_location(); |
149 if (!is_cursor_compositing_enabled_) { | 149 if (!is_cursor_compositing_enabled_) { |
150 Shell::GetPrimaryRootWindow()->GetDispatcher()->host()->ConvertPointToHost( | 150 Shell::GetPrimaryRootWindow()->GetHost()->ConvertPointToHost(&point); |
151 &point); | |
152 } else { | 151 } else { |
153 point.Offset(-bounds_in_screen_.x(), -bounds_in_screen_.y()); | 152 point.Offset(-bounds_in_screen_.x(), -bounds_in_screen_.y()); |
154 } | 153 } |
155 point.Offset(-hot_point_.x(), -hot_point_.y()); | 154 point.Offset(-hot_point_.x(), -hot_point_.y()); |
156 gfx::Rect bounds = cursor_window_->bounds(); | 155 gfx::Rect bounds = cursor_window_->bounds(); |
157 bounds.set_origin(point); | 156 bounds.set_origin(point); |
158 cursor_window_->SetBounds(bounds); | 157 cursor_window_->SetBounds(bounds); |
159 } | 158 } |
160 | 159 |
161 void CursorWindowController::SetCursor(gfx::NativeCursor cursor) { | 160 void CursorWindowController::SetCursor(gfx::NativeCursor cursor) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 if (cursor_window_) { | 255 if (cursor_window_) { |
257 cursor_window_->SetBounds(gfx::Rect(delegate_->size())); | 256 cursor_window_->SetBounds(gfx::Rect(delegate_->size())); |
258 cursor_window_->SchedulePaintInRect( | 257 cursor_window_->SchedulePaintInRect( |
259 gfx::Rect(cursor_window_->bounds().size())); | 258 gfx::Rect(cursor_window_->bounds().size())); |
260 UpdateLocation(); | 259 UpdateLocation(); |
261 } | 260 } |
262 } | 261 } |
263 | 262 |
264 } // namespace internal | 263 } // namespace internal |
265 } // namespace ash | 264 } // namespace ash |
OLD | NEW |