Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Side by Side Diff: components/test_runner/event_sender.cc

Issue 2049323002: [Mac] Don't dispatch wheel events for PhaseMayBegin|Cancelled|Ended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add filter and LayoutTests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/mouse-wheel-main-frame-event.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test_runner/event_sender.h" 5 #include "components/test_runner/event_sender.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2533 } 2533 }
2534 double vertical; 2534 double vertical;
2535 if (!args->GetNext(&vertical)) { 2535 if (!args->GetNext(&vertical)) {
2536 args->ThrowError(); 2536 args->ThrowError();
2537 return; 2537 return;
2538 } 2538 }
2539 2539
2540 bool paged = false; 2540 bool paged = false;
2541 bool has_precise_scrolling_deltas = false; 2541 bool has_precise_scrolling_deltas = false;
2542 int modifiers = 0; 2542 int modifiers = 0;
2543 int phase = 0;
2543 if (!args->PeekNext().IsEmpty()) { 2544 if (!args->PeekNext().IsEmpty()) {
2544 args->GetNext(&paged); 2545 args->GetNext(&paged);
2545 if (!args->PeekNext().IsEmpty()) { 2546 if (!args->PeekNext().IsEmpty()) {
2546 args->GetNext(&has_precise_scrolling_deltas); 2547 args->GetNext(&has_precise_scrolling_deltas);
2547 if (!args->PeekNext().IsEmpty()) { 2548 if (!args->PeekNext().IsEmpty()) {
2548 v8::Local<v8::Value> value; 2549 v8::Local<v8::Value> value;
2549 args->GetNext(&value); 2550 args->GetNext(&value);
2550 modifiers = GetKeyModifiersFromV8(args->isolate(), value); 2551 modifiers = GetKeyModifiersFromV8(args->isolate(), value);
2551 if (!args->PeekNext().IsEmpty()) { 2552 if (!args->PeekNext().IsEmpty()) {
2552 args->GetNext(send_gestures); 2553 args->GetNext(send_gestures);
2554 if (!args->PeekNext().IsEmpty()) {
dtapuska 2016/06/30 19:53:00 This is kind of weird that we will cast a value fr
chongz 2016/07/04 14:12:36 Done.
2555 args->GetNext(&phase);
2556 }
2553 } 2557 }
2554 } 2558 }
2555 } 2559 }
2556 } 2560 }
2557 2561
2558 InitMouseEvent(WebInputEvent::MouseWheel, 2562 InitMouseEvent(WebInputEvent::MouseWheel,
2559 current_pointer_state_[kRawMousePointerId].pressed_button_, 2563 current_pointer_state_[kRawMousePointerId].pressed_button_,
2560 current_pointer_state_[kRawMousePointerId].current_buttons_, 2564 current_pointer_state_[kRawMousePointerId].current_buttons_,
2561 current_pointer_state_[kRawMousePointerId].last_pos_, 2565 current_pointer_state_[kRawMousePointerId].last_pos_,
2562 GetCurrentEventTimeSec(), click_count_, modifiers, event); 2566 GetCurrentEventTimeSec(), click_count_, modifiers, event);
2563 event->wheelTicksX = static_cast<float>(horizontal); 2567 event->wheelTicksX = static_cast<float>(horizontal);
2564 event->wheelTicksY = static_cast<float>(vertical); 2568 event->wheelTicksY = static_cast<float>(vertical);
2565 event->deltaX = event->wheelTicksX; 2569 event->deltaX = event->wheelTicksX;
2566 event->deltaY = event->wheelTicksY; 2570 event->deltaY = event->wheelTicksY;
2567 event->scrollByPage = paged; 2571 event->scrollByPage = paged;
2568 event->hasPreciseScrollingDeltas = has_precise_scrolling_deltas; 2572 event->hasPreciseScrollingDeltas = has_precise_scrolling_deltas;
2573 event->phase = static_cast<WebMouseWheelEvent::Phase>(phase);
2569 if (scroll_type == MouseScrollType::PIXEL) { 2574 if (scroll_type == MouseScrollType::PIXEL) {
2570 event->wheelTicksX /= kScrollbarPixelsPerTick; 2575 event->wheelTicksX /= kScrollbarPixelsPerTick;
2571 event->wheelTicksY /= kScrollbarPixelsPerTick; 2576 event->wheelTicksY /= kScrollbarPixelsPerTick;
2572 } else { 2577 } else {
2573 event->deltaX *= kScrollbarPixelsPerTick; 2578 event->deltaX *= kScrollbarPixelsPerTick;
2574 event->deltaY *= kScrollbarPixelsPerTick; 2579 event->deltaY *= kScrollbarPixelsPerTick;
2575 } 2580 }
2576 } 2581 }
2577 2582
2578 // Radius fields radius_x and radius_y should eventually be moved to 2583 // Radius fields radius_x and radius_y should eventually be moved to
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
2829 } 2834 }
2830 2835
2831 std::unique_ptr<WebInputEvent> EventSender::ScaleEvent( 2836 std::unique_ptr<WebInputEvent> EventSender::ScaleEvent(
2832 const WebInputEvent& event) { 2837 const WebInputEvent& event) {
2833 // ui::ScaleWebInputEvent returns nullptr when the scale is 1.0f as the event 2838 // ui::ScaleWebInputEvent returns nullptr when the scale is 1.0f as the event
2834 // does not have to be converted. 2839 // does not have to be converted.
2835 return ui::ScaleWebInputEvent(event, delegate()->GetWindowToViewportScale()); 2840 return ui::ScaleWebInputEvent(event, delegate()->GetWindowToViewportScale());
2836 } 2841 }
2837 2842
2838 } // namespace test_runner 2843 } // namespace test_runner
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/mouse-wheel-main-frame-event.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698