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 "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 NotifyCursorVisibilityChange(visible); | 148 NotifyCursorVisibilityChange(visible); |
149 } | 149 } |
150 | 150 |
151 void AshNativeCursorManager::SetMouseEventsEnabled( | 151 void AshNativeCursorManager::SetMouseEventsEnabled( |
152 bool enabled, | 152 bool enabled, |
153 ::wm::NativeCursorManagerDelegate* delegate) { | 153 ::wm::NativeCursorManagerDelegate* delegate) { |
154 delegate->CommitMouseEventsEnabled(enabled); | 154 delegate->CommitMouseEventsEnabled(enabled); |
155 | 155 |
156 if (enabled) { | 156 if (enabled) { |
157 aura::Env::GetInstance()->set_last_mouse_location( | 157 aura::Env::GetInstance()->SetLastMouseLocation(disabled_cursor_location_); |
158 disabled_cursor_location_); | |
159 } else { | 158 } else { |
160 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); | 159 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); |
161 } | 160 } |
162 | 161 |
163 SetVisibility(delegate->IsCursorVisible(), delegate); | 162 SetVisibility(delegate->IsCursorVisible(), delegate); |
164 NotifyMouseEventsEnableStateChange(enabled); | 163 NotifyMouseEventsEnableStateChange(enabled); |
165 } | 164 } |
166 | 165 |
167 } // namespace ash | 166 } // namespace ash |
OLD | NEW |