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

Side by Side Diff: content/browser/renderer_host/input/synthetic_mouse_pointer.cc

Issue 2178153002: Prepare SyntheticPointerAction to handle mouse actions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 4 years, 4 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 | content/browser/renderer_host/input/synthetic_pointer_action.cc » ('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 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 "content/browser/renderer_host/input/synthetic_mouse_pointer.h" 5 #include "content/browser/renderer_host/input/synthetic_mouse_pointer.h"
6 6
7 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" 7 #include "content/browser/renderer_host/input/synthetic_gesture_target.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 15 matching lines...) Expand all
26 blink::WebInputEvent::MouseDown, x, y, 0); 26 blink::WebInputEvent::MouseDown, x, y, 0);
27 mouse_event_.clickCount = 1; 27 mouse_event_.clickCount = 1;
28 return 0; 28 return 0;
29 } 29 }
30 30
31 void SyntheticMousePointer::Move(int index, 31 void SyntheticMousePointer::Move(int index,
32 float x, 32 float x,
33 float y, 33 float y,
34 SyntheticGestureTarget* target, 34 SyntheticGestureTarget* target,
35 const base::TimeTicks& timestamp) { 35 const base::TimeTicks& timestamp) {
36 blink::WebMouseEvent::Button button = mouse_event_.button;
37 int click_count = mouse_event_.clickCount;
36 mouse_event_ = SyntheticWebMouseEventBuilder::Build( 38 mouse_event_ = SyntheticWebMouseEventBuilder::Build(
37 blink::WebInputEvent::MouseMove, x, y, 0); 39 blink::WebInputEvent::MouseMove, x, y, 0);
38 mouse_event_.button = blink::WebMouseEvent::ButtonLeft; 40 mouse_event_.button = button;
41 mouse_event_.clickCount = click_count;
39 } 42 }
40 43
41 void SyntheticMousePointer::Release(int index, 44 void SyntheticMousePointer::Release(int index,
42 SyntheticGestureTarget* target, 45 SyntheticGestureTarget* target,
43 const base::TimeTicks& timestamp) { 46 const base::TimeTicks& timestamp) {
44 mouse_event_ = SyntheticWebMouseEventBuilder::Build( 47 mouse_event_ = SyntheticWebMouseEventBuilder::Build(
45 blink::WebInputEvent::MouseUp, mouse_event_.x, mouse_event_.y, 0); 48 blink::WebInputEvent::MouseUp, mouse_event_.x, mouse_event_.y, 0);
46 mouse_event_.clickCount = 1; 49 mouse_event_.clickCount = 1;
47 } 50 }
48 51
49 SyntheticGestureParams::GestureSourceType SyntheticMousePointer::SourceType() 52 SyntheticGestureParams::GestureSourceType SyntheticMousePointer::SourceType()
50 const { 53 const {
51 return SyntheticGestureParams::MOUSE_INPUT; 54 return SyntheticGestureParams::MOUSE_INPUT;
52 } 55 }
53 56
54 } // namespace content 57 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/input/synthetic_pointer_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698