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 | |
133 void AshNativeCursorManager::SetVisibility( | 123 void AshNativeCursorManager::SetVisibility( |
134 bool visible, | 124 bool visible, |
135 ::wm::NativeCursorManagerDelegate* delegate) { | 125 ::wm::NativeCursorManagerDelegate* delegate) { |
136 delegate->CommitVisibility(visible); | 126 delegate->CommitVisibility(visible); |
137 | 127 |
138 if (visible) { | 128 if (visible) { |
139 SetCursor(delegate->GetCursor(), delegate); | 129 SetCursor(delegate->GetCursor(), delegate); |
140 } else { | 130 } else { |
141 gfx::NativeCursor invisible_cursor(ui::kCursorNone); | 131 gfx::NativeCursor invisible_cursor(ui::kCursorNone); |
142 image_cursors_->SetPlatformCursor(&invisible_cursor); | 132 image_cursors_->SetPlatformCursor(&invisible_cursor); |
(...skipping 13 matching lines...) Expand all Loading... |
156 disabled_cursor_location_); | 146 disabled_cursor_location_); |
157 } else { | 147 } else { |
158 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); | 148 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); |
159 } | 149 } |
160 | 150 |
161 SetVisibility(delegate->IsCursorVisible(), delegate); | 151 SetVisibility(delegate->IsCursorVisible(), delegate); |
162 NotifyMouseEventsEnableStateChange(enabled); | 152 NotifyMouseEventsEnableStateChange(enabled); |
163 } | 153 } |
164 | 154 |
165 } // namespace ash | 155 } // namespace ash |
OLD | NEW |