| 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/ash_constants.h" | 7 #include "ash/ash_constants.h" |
| 8 #include "ash/display/mirror_window_controller.h" | 8 #include "ash/display/mirror_window_controller.h" |
| 9 #include "ash/display/window_tree_host_manager.h" | 9 #include "ash/display/window_tree_host_manager.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 return; | 155 return; |
| 156 } | 156 } |
| 157 | 157 |
| 158 display_ = display; | 158 display_ = display; |
| 159 aura::Window* root_window = | 159 aura::Window* root_window = |
| 160 Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId( | 160 Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId( |
| 161 display.id()); | 161 display.id()); |
| 162 if (!root_window) | 162 if (!root_window) |
| 163 return; | 163 return; |
| 164 | 164 |
| 165 SetContainer(GetRootWindowController(root_window) | 165 SetContainer(RootWindowController::ForWindow(root_window) |
| 166 ->GetContainer(kShellWindowId_MouseCursorContainer)); | 166 ->GetContainer(kShellWindowId_MouseCursorContainer)); |
| 167 SetBoundsInScreen(display.bounds()); | 167 SetBoundsInScreen(display.bounds()); |
| 168 // Updates the hot point based on the current display. | 168 // Updates the hot point based on the current display. |
| 169 UpdateCursorImage(); | 169 UpdateCursorImage(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void CursorWindowController::UpdateLocation() { | 172 void CursorWindowController::UpdateLocation() { |
| 173 if (!cursor_window_) | 173 if (!cursor_window_) |
| 174 return; | 174 return; |
| 175 gfx::Point point = aura::Env::GetInstance()->last_mouse_location(); | 175 gfx::Point point = aura::Env::GetInstance()->last_mouse_location(); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 cursor_window_->Show(); | 324 cursor_window_->Show(); |
| 325 else | 325 else |
| 326 cursor_window_->Hide(); | 326 cursor_window_->Hide(); |
| 327 } | 327 } |
| 328 | 328 |
| 329 const gfx::ImageSkia& CursorWindowController::GetCursorImageForTest() const { | 329 const gfx::ImageSkia& CursorWindowController::GetCursorImageForTest() const { |
| 330 return delegate_->cursor_image(); | 330 return delegate_->cursor_image(); |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace ash | 333 } // namespace ash |
| OLD | NEW |