| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // Sets the cursor to reflect the scale change immediately. | 113 // Sets the cursor to reflect the scale change immediately. |
| 114 if (delegate->IsCursorVisible()) | 114 if (delegate->IsCursorVisible()) |
| 115 SetCursor(delegate->GetCursor(), delegate); | 115 SetCursor(delegate->GetCursor(), delegate); |
| 116 | 116 |
| 117 #if defined(OS_CHROMEOS) | 117 #if defined(OS_CHROMEOS) |
| 118 Shell::GetInstance()->display_controller()->cursor_window_controller()-> | 118 Shell::GetInstance()->display_controller()->cursor_window_controller()-> |
| 119 SetCursorSet(cursor_set); | 119 SetCursorSet(cursor_set); |
| 120 #endif | 120 #endif |
| 121 } | 121 } |
| 122 | 122 |
| 123 void AshNativeCursorManager::SetScale( |
| 124 float scale, |
| 125 ::wm::NativeCursorManagerDelegate* delegate) { |
| 126 image_cursors_->SetScale(scale); |
| 127 delegate->CommitScale(scale); |
| 128 |
| 129 // Sets the cursor to reflect the scale change immediately. |
| 130 SetCursor(delegate->GetCursor(), delegate); |
| 131 } |
| 132 |
| 123 void AshNativeCursorManager::SetVisibility( | 133 void AshNativeCursorManager::SetVisibility( |
| 124 bool visible, | 134 bool visible, |
| 125 ::wm::NativeCursorManagerDelegate* delegate) { | 135 ::wm::NativeCursorManagerDelegate* delegate) { |
| 126 delegate->CommitVisibility(visible); | 136 delegate->CommitVisibility(visible); |
| 127 | 137 |
| 128 if (visible) { | 138 if (visible) { |
| 129 SetCursor(delegate->GetCursor(), delegate); | 139 SetCursor(delegate->GetCursor(), delegate); |
| 130 } else { | 140 } else { |
| 131 gfx::NativeCursor invisible_cursor(ui::kCursorNone); | 141 gfx::NativeCursor invisible_cursor(ui::kCursorNone); |
| 132 image_cursors_->SetPlatformCursor(&invisible_cursor); | 142 image_cursors_->SetPlatformCursor(&invisible_cursor); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 146 disabled_cursor_location_); | 156 disabled_cursor_location_); |
| 147 } else { | 157 } else { |
| 148 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); | 158 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); |
| 149 } | 159 } |
| 150 | 160 |
| 151 SetVisibility(delegate->IsCursorVisible(), delegate); | 161 SetVisibility(delegate->IsCursorVisible(), delegate); |
| 152 NotifyMouseEventsEnableStateChange(enabled); | 162 NotifyMouseEventsEnableStateChange(enabled); |
| 153 } | 163 } |
| 154 | 164 |
| 155 } // namespace ash | 165 } // namespace ash |
| OLD | NEW |