| 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_manager.h" | |
| 8 #include "ash/display/mirror_window_controller.h" | 7 #include "ash/display/mirror_window_controller.h" |
| 9 #include "ash/display/window_tree_host_manager.h" | 8 #include "ash/display/window_tree_host_manager.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 11 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| 12 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 13 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
| 14 #include "ui/aura/window_delegate.h" | 13 #include "ui/aura/window_delegate.h" |
| 15 #include "ui/aura/window_event_dispatcher.h" | 14 #include "ui/aura/window_event_dispatcher.h" |
| 16 #include "ui/base/cursor/cursors_aura.h" | 15 #include "ui/base/cursor/cursors_aura.h" |
| 17 #include "ui/base/hit_test.h" | 16 #include "ui/base/hit_test.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/compositor/dip_util.h" | 18 #include "ui/compositor/dip_util.h" |
| 20 #include "ui/compositor/paint_recorder.h" | 19 #include "ui/compositor/paint_recorder.h" |
| 21 #include "ui/display/display.h" | 20 #include "ui/display/display.h" |
| 21 #include "ui/display/manager/display_manager.h" |
| 22 #include "ui/display/screen.h" | 22 #include "ui/display/screen.h" |
| 23 #include "ui/gfx/canvas.h" | 23 #include "ui/gfx/canvas.h" |
| 24 #include "ui/gfx/geometry/dip_util.h" | 24 #include "ui/gfx/geometry/dip_util.h" |
| 25 #include "ui/gfx/image/image_skia.h" | 25 #include "ui/gfx/image/image_skia.h" |
| 26 #include "ui/gfx/image/image_skia_operations.h" | 26 #include "ui/gfx/image/image_skia_operations.h" |
| 27 | 27 |
| 28 namespace ash { | 28 namespace ash { |
| 29 | 29 |
| 30 class CursorWindowDelegate : public aura::WindowDelegate { | 30 class CursorWindowDelegate : public aura::WindowDelegate { |
| 31 public: | 31 public: |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 UpdateCursorImage(); | 120 UpdateCursorImage(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void CursorWindowController::SetDisplay(const display::Display& display) { | 123 void CursorWindowController::SetDisplay(const display::Display& display) { |
| 124 if (!is_cursor_compositing_enabled_) | 124 if (!is_cursor_compositing_enabled_) |
| 125 return; | 125 return; |
| 126 | 126 |
| 127 // TODO(oshima): Do not updatethe composition cursor when crossing | 127 // TODO(oshima): Do not updatethe composition cursor when crossing |
| 128 // display in unified desktop mode for now. crbug.com/517222. | 128 // display in unified desktop mode for now. crbug.com/517222. |
| 129 if (Shell::GetInstance()->display_manager()->IsInUnifiedMode() && | 129 if (Shell::GetInstance()->display_manager()->IsInUnifiedMode() && |
| 130 display.id() != DisplayManager::kUnifiedDisplayId) { | 130 display.id() != display::DisplayManager::kUnifiedDisplayId) { |
| 131 return; | 131 return; |
| 132 } | 132 } |
| 133 | 133 |
| 134 display_ = display; | 134 display_ = display; |
| 135 aura::Window* root_window = Shell::GetInstance() | 135 aura::Window* root_window = Shell::GetInstance() |
| 136 ->window_tree_host_manager() | 136 ->window_tree_host_manager() |
| 137 ->GetRootWindowForDisplayId(display.id()); | 137 ->GetRootWindowForDisplayId(display.id()); |
| 138 if (!root_window) | 138 if (!root_window) |
| 139 return; | 139 return; |
| 140 | 140 |
| (...skipping 141 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 |