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 #ifndef COMPONENTS_SCHEDULER_RENDERER_USER_MODEL_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_USER_MODEL_H_ |
6 #define COMPONENTS_SCHEDULER_RENDERER_USER_MODEL_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_USER_MODEL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
11 #include "components/scheduler/renderer/renderer_scheduler.h" | 11 #include "public/platform/scheduler/renderer/renderer_scheduler.h" |
12 #include "components/scheduler/scheduler_export.h" | 12 #include "public/platform/WebCommon.h" |
13 #include "third_party/WebKit/public/web/WebInputEvent.h" | 13 #include "public/platform/WebInputEvent.h" |
14 | 14 |
| 15 namespace blink { |
15 namespace scheduler { | 16 namespace scheduler { |
16 | 17 |
17 class SCHEDULER_EXPORT UserModel { | 18 class BLINK_PLATFORM_EXPORT UserModel { |
18 public: | 19 public: |
19 UserModel(); | 20 UserModel(); |
20 ~UserModel(); | 21 ~UserModel(); |
21 | 22 |
22 // Tells us that the system started processing an input event. Must be paired | 23 // Tells us that the system started processing an input event. Must be paired |
23 // with a call to DidFinishProcessingInputEvent. | 24 // with a call to DidFinishProcessingInputEvent. |
24 void DidStartProcessingInputEvent(blink::WebInputEvent::Type type, | 25 void DidStartProcessingInputEvent(WebInputEvent::Type type, |
25 const base::TimeTicks now); | 26 const base::TimeTicks now); |
26 | 27 |
27 // Tells us that the system finished processing an input event. | 28 // Tells us that the system finished processing an input event. |
28 void DidFinishProcessingInputEvent(const base::TimeTicks now); | 29 void DidFinishProcessingInputEvent(const base::TimeTicks now); |
29 | 30 |
30 // Returns the estimated amount of time left in the current user gesture, to a | 31 // Returns the estimated amount of time left in the current user gesture, to a |
31 // maximum of |kGestureEstimationLimitMillis|. After that time has elapased | 32 // maximum of |kGestureEstimationLimitMillis|. After that time has elapased |
32 // this function should be called again. | 33 // this function should be called again. |
33 base::TimeDelta TimeLeftInUserGesture(base::TimeTicks now) const; | 34 base::TimeDelta TimeLeftInUserGesture(base::TimeTicks now) const; |
34 | 35 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 base::TimeTicks last_continuous_gesture_time_; // Doesn't include Taps. | 74 base::TimeTicks last_continuous_gesture_time_; // Doesn't include Taps. |
74 base::TimeTicks last_gesture_expected_start_time_; | 75 base::TimeTicks last_gesture_expected_start_time_; |
75 base::TimeTicks last_reset_time_; | 76 base::TimeTicks last_reset_time_; |
76 bool is_gesture_active_; // This typically means the user's finger is down. | 77 bool is_gesture_active_; // This typically means the user's finger is down. |
77 bool is_gesture_expected_; | 78 bool is_gesture_expected_; |
78 | 79 |
79 DISALLOW_COPY_AND_ASSIGN(UserModel); | 80 DISALLOW_COPY_AND_ASSIGN(UserModel); |
80 }; | 81 }; |
81 | 82 |
82 } // namespace scheduler | 83 } // namespace scheduler |
| 84 } // namespace blink |
83 | 85 |
84 #endif // COMPONENTS_SCHEDULER_RENDERER_USER_MODEL_H_ | 86 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_USER_MODEL_H_ |
OLD | NEW |