OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/pointer.h" | 5 #include "components/exo/pointer.h" |
6 | 6 |
7 #include "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
9 #include "cc/output/copy_output_result.h" | 9 #include "cc/output/copy_output_result.h" |
10 #include "components/exo/pointer_delegate.h" | 10 #include "components/exo/pointer_delegate.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 static_cast<ui::MouseWheelEvent*>(event)->offset(), true); | 205 static_cast<ui::MouseWheelEvent*>(event)->offset(), true); |
206 delegate_->OnPointerFrame(); | 206 delegate_->OnPointerFrame(); |
207 break; | 207 break; |
208 } | 208 } |
209 case ui::ET_SCROLL_FLING_START: { | 209 case ui::ET_SCROLL_FLING_START: { |
210 delegate_->OnPointerScrollStop(event->time_stamp()); | 210 delegate_->OnPointerScrollStop(event->time_stamp()); |
211 delegate_->OnPointerFrame(); | 211 delegate_->OnPointerFrame(); |
212 break; | 212 break; |
213 } | 213 } |
214 case ui::ET_SCROLL_FLING_CANCEL: { | 214 case ui::ET_SCROLL_FLING_CANCEL: { |
215 delegate_->OnPointerScrollCancel(event->time_stamp()); | 215 if (last_event_type_ == ui::ET_SCROLL_FLING_START) { |
reveman
2017/04/27 13:28:17
Can you add a comment here that explains why we do
denniskempin (chromium)
2017/05/03 20:55:28
Done.
| |
216 delegate_->OnPointerFrame(); | 216 delegate_->OnPointerScroll(event->time_stamp(), gfx::Vector2dF(), |
reveman
2017/04/27 13:28:17
I think this logic deserves a comment similar to w
denniskempin (chromium)
2017/05/03 20:55:28
Done.
| |
217 false); | |
218 delegate_->OnPointerFrame(); | |
219 delegate_->OnPointerScrollStop(event->time_stamp()); | |
220 delegate_->OnPointerFrame(); | |
221 } | |
217 break; | 222 break; |
218 } | 223 } |
219 case ui::ET_MOUSE_MOVED: | 224 case ui::ET_MOUSE_MOVED: |
220 case ui::ET_MOUSE_DRAGGED: | 225 case ui::ET_MOUSE_DRAGGED: |
221 case ui::ET_MOUSE_ENTERED: | 226 case ui::ET_MOUSE_ENTERED: |
222 case ui::ET_MOUSE_EXITED: | 227 case ui::ET_MOUSE_EXITED: |
223 case ui::ET_MOUSE_CAPTURE_CHANGED: | 228 case ui::ET_MOUSE_CAPTURE_CHANGED: |
224 break; | 229 break; |
225 default: | 230 default: |
226 NOTREACHED(); | 231 NOTREACHED(); |
227 break; | 232 break; |
228 } | 233 } |
229 | 234 |
235 last_event_type_ = event->type(); | |
230 UpdateCursorScale(); | 236 UpdateCursorScale(); |
231 } | 237 } |
232 | 238 |
233 void Pointer::OnScrollEvent(ui::ScrollEvent* event) { | 239 void Pointer::OnScrollEvent(ui::ScrollEvent* event) { |
234 OnMouseEvent(event); | 240 OnMouseEvent(event); |
235 } | 241 } |
236 | 242 |
237 //////////////////////////////////////////////////////////////////////////////// | 243 //////////////////////////////////////////////////////////////////////////////// |
238 // WMHelper::CursorObserver overrides: | 244 // WMHelper::CursorObserver overrides: |
239 | 245 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 if (!root_window) | 388 if (!root_window) |
383 return; | 389 return; |
384 | 390 |
385 aura::client::CursorClient* cursor_client = | 391 aura::client::CursorClient* cursor_client = |
386 aura::client::GetCursorClient(root_window); | 392 aura::client::GetCursorClient(root_window); |
387 if (cursor_client) | 393 if (cursor_client) |
388 cursor_client->SetCursor(cursor_); | 394 cursor_client->SetCursor(cursor_); |
389 } | 395 } |
390 | 396 |
391 } // namespace exo | 397 } // namespace exo |
OLD | NEW |