OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/wm/ash_native_cursor_manager.h" | 5 #include "ash/wm/ash_native_cursor_manager.h" |
6 | 6 |
7 #include "ash/display/cursor_window_controller.h" | 7 #include "ash/display/cursor_window_controller.h" |
8 #include "ash/display/display_controller.h" | 8 #include "ash/display/display_controller.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/image_cursors.h" | 10 #include "ash/wm/image_cursors.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 image_cursors_->SetPlatformCursor(&new_cursor); | 88 image_cursors_->SetPlatformCursor(&new_cursor); |
89 } else { | 89 } else { |
90 gfx::NativeCursor invisible_cursor(ui::kCursorNone); | 90 gfx::NativeCursor invisible_cursor(ui::kCursorNone); |
91 image_cursors_->SetPlatformCursor(&invisible_cursor); | 91 image_cursors_->SetPlatformCursor(&invisible_cursor); |
92 if (new_cursor == ui::kCursorCustom) { | 92 if (new_cursor == ui::kCursorCustom) { |
93 new_cursor = invisible_cursor; | 93 new_cursor = invisible_cursor; |
94 } else { | 94 } else { |
95 new_cursor.SetPlatformCursor(invisible_cursor.platform()); | 95 new_cursor.SetPlatformCursor(invisible_cursor.platform()); |
96 } | 96 } |
97 } | 97 } |
98 new_cursor.set_device_scale_factor( | 98 new_cursor.set_device_scale_factor(image_cursors_->GetScale()); |
99 image_cursors_->GetDisplay().device_scale_factor()); | |
100 | 99 |
101 delegate->CommitCursor(new_cursor); | 100 delegate->CommitCursor(new_cursor); |
102 | 101 |
103 if (delegate->IsCursorVisible()) | 102 if (delegate->IsCursorVisible()) |
104 SetCursorOnAllRootWindows(new_cursor); | 103 SetCursorOnAllRootWindows(new_cursor); |
105 } | 104 } |
106 | 105 |
107 void AshNativeCursorManager::SetCursorSet( | 106 void AshNativeCursorManager::SetCursorSet( |
108 ui::CursorSetType cursor_set, | 107 ui::CursorSetType cursor_set, |
109 ::wm::NativeCursorManagerDelegate* delegate) { | 108 ::wm::NativeCursorManagerDelegate* delegate) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 disabled_cursor_location_); | 145 disabled_cursor_location_); |
147 } else { | 146 } else { |
148 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); | 147 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); |
149 } | 148 } |
150 | 149 |
151 SetVisibility(delegate->IsCursorVisible(), delegate); | 150 SetVisibility(delegate->IsCursorVisible(), delegate); |
152 NotifyMouseEventsEnableStateChange(enabled); | 151 NotifyMouseEventsEnableStateChange(enabled); |
153 } | 152 } |
154 | 153 |
155 } // namespace ash | 154 } // namespace ash |
OLD | NEW |