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

Side by Side Diff: content/shell/renderer/test_runner/event_sender.cc

Issue 301103002: Update EventSender::GestureTap to return a bool (if handled). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return a proper result from EventSender. Created 6 years, 6 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 | no next file » | 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 "content/shell/renderer/test_runner/event_sender.h" 5 #include "content/shell/renderer/test_runner/event_sender.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "content/public/common/page_zoom.h" 10 #include "content/public/common/page_zoom.h"
(...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 NOTREACHED(); 2060 NOTREACHED();
2061 } 2061 }
2062 2062
2063 event.globalX = event.x; 2063 event.globalX = event.x;
2064 event.globalY = event.y; 2064 event.globalY = event.y;
2065 event.timeStampSeconds = GetCurrentEventTimeSec(); 2065 event.timeStampSeconds = GetCurrentEventTimeSec();
2066 2066
2067 if (force_layout_on_events_) 2067 if (force_layout_on_events_)
2068 view_->layout(); 2068 view_->layout();
2069 2069
2070 view_->handleInputEvent(event); 2070 bool result = view_->handleInputEvent(event);
2071 2071
2072 // Long press might start a drag drop session. Complete it if so. 2072 // Long press might start a drag drop session. Complete it if so.
2073 if (type == WebInputEvent::GestureLongPress && !current_drag_data_.isNull()) { 2073 if (type == WebInputEvent::GestureLongPress && !current_drag_data_.isNull()) {
2074 WebMouseEvent mouse_event; 2074 WebMouseEvent mouse_event;
2075 InitMouseEvent(WebInputEvent::MouseDown, 2075 InitMouseEvent(WebInputEvent::MouseDown,
2076 pressed_button_, 2076 pressed_button_,
2077 point, 2077 point,
2078 GetCurrentEventTimeSec(), 2078 GetCurrentEventTimeSec(),
2079 click_count_, 2079 click_count_,
2080 0, 2080 0,
2081 &mouse_event); 2081 &mouse_event);
2082 2082
2083 FinishDragAndDrop(mouse_event, blink::WebDragOperationNone); 2083 FinishDragAndDrop(mouse_event, blink::WebDragOperationNone);
2084 } 2084 }
2085 args->Return(result);
2085 } 2086 }
2086 2087
2087 void EventSender::UpdateClickCountForButton( 2088 void EventSender::UpdateClickCountForButton(
2088 WebMouseEvent::Button button_type) { 2089 WebMouseEvent::Button button_type) {
2089 if ((GetCurrentEventTimeSec() - last_click_time_sec_ < 2090 if ((GetCurrentEventTimeSec() - last_click_time_sec_ <
2090 kMultipleClickTimeSec) && 2091 kMultipleClickTimeSec) &&
2091 (!OutsideMultiClickRadius(last_mouse_pos_, last_click_pos_)) && 2092 (!OutsideMultiClickRadius(last_mouse_pos_, last_click_pos_)) &&
2092 (button_type == last_button_type_)) { 2093 (button_type == last_button_type_)) {
2093 ++click_count_; 2094 ++click_count_;
2094 } else { 2095 } else {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 } 2242 }
2242 default: 2243 default:
2243 NOTREACHED(); 2244 NOTREACHED();
2244 } 2245 }
2245 } 2246 }
2246 2247
2247 replaying_saved_events_ = false; 2248 replaying_saved_events_ = false;
2248 } 2249 }
2249 2250
2250 } // namespace content 2251 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698