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

Side by Side Diff: content/browser/renderer_host/input/motion_event_web.h

Issue 178193022: [Android] Always insert a TouchCancel if window or tab focus is lost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 9 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
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_
7 7
8 #include "third_party/WebKit/public/web/WebInputEvent.h" 8 #include "third_party/WebKit/public/web/WebInputEvent.h"
9 #include "ui/events/gesture_detection/motion_event.h" 9 #include "ui/events/gesture_detection/motion_event.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 // Implementation of ui::MotionEvent wrapping a WebTouchEvent. 13 // Implementation of ui::MotionEvent wrapping a WebTouchEvent.
14 class MotionEventWeb : public ui::MotionEvent { 14 class MotionEventWeb : public ui::MotionEvent {
15 public: 15 public:
16 explicit MotionEventWeb(const blink::WebTouchEvent& event); 16 explicit MotionEventWeb(const blink::WebTouchEvent& event);
17 virtual ~MotionEventWeb(); 17 virtual ~MotionEventWeb();
18 18
19 // ui::MotionEvent 19 // ui::MotionEvent
20 virtual Action GetAction() const OVERRIDE; 20 virtual Action GetAction() const OVERRIDE;
21 virtual int GetActionIndex() const OVERRIDE; 21 virtual int GetActionIndex() const OVERRIDE;
22 virtual size_t GetPointerCount() const OVERRIDE; 22 virtual size_t GetPointerCount() const OVERRIDE;
23 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; 23 virtual int GetPointerId(size_t pointer_index) const OVERRIDE;
24 virtual float GetX(size_t pointer_index) const OVERRIDE; 24 virtual float GetX(size_t pointer_index) const OVERRIDE;
25 virtual float GetY(size_t pointer_index) const OVERRIDE; 25 virtual float GetY(size_t pointer_index) const OVERRIDE;
26 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; 26 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE;
27 virtual float GetPressure(size_t pointer_index) const OVERRIDE;
27 virtual base::TimeTicks GetEventTime() const OVERRIDE; 28 virtual base::TimeTicks GetEventTime() const OVERRIDE;
28 virtual size_t GetHistorySize() const OVERRIDE; 29 virtual size_t GetHistorySize() const OVERRIDE;
29 virtual base::TimeTicks GetHistoricalEventTime( 30 virtual base::TimeTicks GetHistoricalEventTime(
30 size_t historical_index) const OVERRIDE; 31 size_t historical_index) const OVERRIDE;
31 virtual float GetHistoricalTouchMajor( 32 virtual float GetHistoricalTouchMajor(
32 size_t pointer_index, 33 size_t pointer_index,
33 size_t historical_index) const OVERRIDE; 34 size_t historical_index) const OVERRIDE;
34 virtual float GetHistoricalX( 35 virtual float GetHistoricalX(
35 size_t pointer_index, 36 size_t pointer_index,
36 size_t historical_index) const OVERRIDE; 37 size_t historical_index) const OVERRIDE;
37 virtual float GetHistoricalY( 38 virtual float GetHistoricalY(
38 size_t pointer_index, 39 size_t pointer_index,
39 size_t historical_index) const OVERRIDE; 40 size_t historical_index) const OVERRIDE;
40 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; 41 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
41 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; 42 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
42 43
43 private: 44 private:
44 blink::WebTouchEvent event_; 45 blink::WebTouchEvent event_;
45 Action cached_action_; 46 Action cached_action_;
46 int cached_action_index_; 47 int cached_action_index_;
47 48
48 DISALLOW_COPY_AND_ASSIGN(MotionEventWeb); 49 DISALLOW_COPY_AND_ASSIGN(MotionEventWeb);
49 }; 50 };
50 51
51 } // namespace content 52 } // namespace content
52 53
53 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_ 54 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/motion_event_android.cc ('k') | content/browser/renderer_host/input/motion_event_web.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698