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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 container_ = container; | 190 container_ = container; |
191 if (!container) { | 191 if (!container) { |
192 cursor_window_.reset(); | 192 cursor_window_.reset(); |
193 return; | 193 return; |
194 } | 194 } |
195 | 195 |
196 // Reusing the window does not work when the display is disconnected. | 196 // Reusing the window does not work when the display is disconnected. |
197 // Just creates a new one instead. crbug.com/384218. | 197 // Just creates a new one instead. crbug.com/384218. |
198 cursor_window_.reset(new aura::Window(delegate_.get())); | 198 cursor_window_.reset(new aura::Window(delegate_.get())); |
199 cursor_window_->SetTransparent(true); | 199 cursor_window_->SetTransparent(true); |
200 cursor_window_->Init(aura::WINDOW_LAYER_TEXTURED); | 200 cursor_window_->Init(ui::LAYER_TEXTURED); |
201 cursor_window_->set_ignore_events(true); | 201 cursor_window_->set_ignore_events(true); |
202 cursor_window_->set_owned_by_parent(false); | 202 cursor_window_->set_owned_by_parent(false); |
203 // Call UpdateCursorImage() to figure out |cursor_window_|'s desired size. | 203 // Call UpdateCursorImage() to figure out |cursor_window_|'s desired size. |
204 UpdateCursorImage(); | 204 UpdateCursorImage(); |
205 | 205 |
206 container->AddChild(cursor_window_.get()); | 206 container->AddChild(cursor_window_.get()); |
207 UpdateCursorVisibility(); | 207 UpdateCursorVisibility(); |
208 SetBoundsInScreen(container->bounds()); | 208 SetBoundsInScreen(container->bounds()); |
209 } | 209 } |
210 | 210 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 if (!cursor_window_) | 269 if (!cursor_window_) |
270 return; | 270 return; |
271 bool visible = (visible_ && cursor_type_ != ui::kCursorNone); | 271 bool visible = (visible_ && cursor_type_ != ui::kCursorNone); |
272 if (visible) | 272 if (visible) |
273 cursor_window_->Show(); | 273 cursor_window_->Show(); |
274 else | 274 else |
275 cursor_window_->Hide(); | 275 cursor_window_->Hide(); |
276 } | 276 } |
277 | 277 |
278 } // namespace ash | 278 } // namespace ash |
OLD | NEW |