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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 UpdateCursorImage(); | 110 UpdateCursorImage(); |
111 UpdateContainer(); | 111 UpdateContainer(); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 void CursorWindowController::UpdateContainer() { | 115 void CursorWindowController::UpdateContainer() { |
116 display_ = Shell::GetScreen()->GetPrimaryDisplay(); | 116 display_ = Shell::GetScreen()->GetPrimaryDisplay(); |
117 if (is_cursor_compositing_enabled_) { | 117 if (is_cursor_compositing_enabled_) { |
118 SetDisplay(display_); | 118 SetDisplay(display_); |
119 } else { | 119 } else { |
120 aura::WindowTreeHost* mirror_host = Shell::GetInstance()-> | 120 SetContainer(Shell::GetInstance()-> |
121 display_controller()->mirror_window_controller()->host(); | 121 display_controller()-> |
122 SetContainer(mirror_host ? mirror_host->window() : NULL); | 122 mirror_window_controller()-> |
| 123 GetWindow()); |
123 } | 124 } |
124 } | 125 } |
125 | 126 |
126 void CursorWindowController::SetDisplay(const gfx::Display& display) { | 127 void CursorWindowController::SetDisplay(const gfx::Display& display) { |
127 if (!is_cursor_compositing_enabled_) | 128 if (!is_cursor_compositing_enabled_) |
128 return; | 129 return; |
129 | 130 |
130 display_ = display; | 131 display_ = display; |
131 aura::Window* root_window = Shell::GetInstance()->display_controller()-> | 132 aura::Window* root_window = Shell::GetInstance()->display_controller()-> |
132 GetRootWindowForDisplayId(display.id()); | 133 GetRootWindowForDisplayId(display.id()); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 delegate_->SetCursorImage(rotated, display_); | 252 delegate_->SetCursorImage(rotated, display_); |
252 if (cursor_window_) { | 253 if (cursor_window_) { |
253 cursor_window_->SetBounds(gfx::Rect(delegate_->size())); | 254 cursor_window_->SetBounds(gfx::Rect(delegate_->size())); |
254 cursor_window_->SchedulePaintInRect( | 255 cursor_window_->SchedulePaintInRect( |
255 gfx::Rect(cursor_window_->bounds().size())); | 256 gfx::Rect(cursor_window_->bounds().size())); |
256 UpdateLocation(); | 257 UpdateLocation(); |
257 } | 258 } |
258 } | 259 } |
259 | 260 |
260 } // namespace ash | 261 } // namespace ash |
OLD | NEW |