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/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
9 #include "components/exo/pointer_delegate.h" | 9 #include "components/exo/pointer_delegate.h" |
10 #include "components/exo/pointer_stylus_delegate.h" | 10 #include "components/exo/pointer_stylus_delegate.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 delegate_->OnPointerFrame(); | 240 delegate_->OnPointerFrame(); |
241 } | 241 } |
242 break; | 242 break; |
243 case ui::ET_SCROLL_FLING_START: | 243 case ui::ET_SCROLL_FLING_START: |
244 if (focus_) { | 244 if (focus_) { |
245 delegate_->OnPointerScrollStop(event->time_stamp()); | 245 delegate_->OnPointerScrollStop(event->time_stamp()); |
246 delegate_->OnPointerFrame(); | 246 delegate_->OnPointerFrame(); |
247 } | 247 } |
248 break; | 248 break; |
249 case ui::ET_SCROLL_FLING_CANCEL: | 249 case ui::ET_SCROLL_FLING_CANCEL: |
250 if (focus_) { | 250 if (focus_ && last_event_type_ == ui::ET_SCROLL_FLING_START) { |
251 delegate_->OnPointerScrollCancel(event->time_stamp()); | 251 delegate_->OnPointerScroll(event->time_stamp(), gfx::Vector2dF(), |
reveman
2016/10/31 02:25:12
can we remove OnPointerScrollCancel from the deleg
denniskempin
2016/10/31 17:33:48
Done.
| |
252 false); | |
253 delegate_->OnPointerFrame(); | |
254 delegate_->OnPointerScrollStop(event->time_stamp()); | |
252 delegate_->OnPointerFrame(); | 255 delegate_->OnPointerFrame(); |
253 } | 256 } |
254 break; | 257 break; |
255 case ui::ET_MOUSE_MOVED: | 258 case ui::ET_MOUSE_MOVED: |
256 case ui::ET_MOUSE_DRAGGED: | 259 case ui::ET_MOUSE_DRAGGED: |
257 case ui::ET_MOUSE_ENTERED: | 260 case ui::ET_MOUSE_ENTERED: |
258 case ui::ET_MOUSE_EXITED: | 261 case ui::ET_MOUSE_EXITED: |
259 case ui::ET_MOUSE_CAPTURE_CHANGED: | 262 case ui::ET_MOUSE_CAPTURE_CHANGED: |
260 break; | 263 break; |
261 default: | 264 default: |
(...skipping 17 matching lines...) Expand all Loading... | |
279 widget_->SetBounds(bounds); | 282 widget_->SetBounds(bounds); |
280 } | 283 } |
281 | 284 |
282 UpdateCursorScale(); | 285 UpdateCursorScale(); |
283 if (!widget_->IsVisible()) | 286 if (!widget_->IsVisible()) |
284 widget_->Show(); | 287 widget_->Show(); |
285 } else { | 288 } else { |
286 if (widget_ && widget_->IsVisible()) | 289 if (widget_ && widget_->IsVisible()) |
287 widget_->Hide(); | 290 widget_->Hide(); |
288 } | 291 } |
292 | |
293 if ((event->flags() & ui::EF_IS_SYNTHESIZED) == 0) | |
reveman
2016/10/31 02:25:12
can we merge this with the "event->flags() & ui::E
denniskempin
2016/10/31 17:33:49
Done.
| |
294 last_event_type_ = event->type(); | |
289 } | 295 } |
290 | 296 |
291 void Pointer::OnScrollEvent(ui::ScrollEvent* event) { | 297 void Pointer::OnScrollEvent(ui::ScrollEvent* event) { |
292 OnMouseEvent(event); | 298 OnMouseEvent(event); |
293 } | 299 } |
294 | 300 |
295 void Pointer::OnCursorSetChanged(ui::CursorSetType cursor_set) { | 301 void Pointer::OnCursorSetChanged(ui::CursorSetType cursor_set) { |
296 UpdateCursorScale(); | 302 UpdateCursorScale(); |
297 } | 303 } |
298 | 304 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 | 375 |
370 if (ui_scale != cursor_scale_) { | 376 if (ui_scale != cursor_scale_) { |
371 gfx::Transform transform; | 377 gfx::Transform transform; |
372 transform.Scale(ui_scale, ui_scale); | 378 transform.Scale(ui_scale, ui_scale); |
373 widget_->GetNativeWindow()->SetTransform(transform); | 379 widget_->GetNativeWindow()->SetTransform(transform); |
374 cursor_scale_ = ui_scale; | 380 cursor_scale_ = ui_scale; |
375 } | 381 } |
376 } | 382 } |
377 | 383 |
378 } // namespace exo | 384 } // namespace exo |
OLD | NEW |