OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 BASE_MESSAGE_PUMP_ANDROID_H_ | 5 #ifndef BASE_MESSAGE_PUMP_ANDROID_H_ |
6 #define BASE_MESSAGE_PUMP_ANDROID_H_ | 6 #define BASE_MESSAGE_PUMP_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/message_pump.h" | 11 #include "base/message_pump.h" |
12 #include "base/time.h" | |
13 | 12 |
14 namespace base { | 13 namespace base { |
| 14 |
15 class RunLoop; | 15 class RunLoop; |
| 16 class TimeTicks; |
16 | 17 |
17 // This class implements a MessagePump needed for TYPE_UI MessageLoops on | 18 // This class implements a MessagePump needed for TYPE_UI MessageLoops on |
18 // OS_ANDROID platform. | 19 // OS_ANDROID platform. |
19 class MessagePumpForUI : public MessagePump { | 20 class MessagePumpForUI : public MessagePump { |
20 public: | 21 public: |
21 MessagePumpForUI(); | 22 MessagePumpForUI(); |
22 | 23 |
23 virtual void Run(Delegate* delegate) OVERRIDE; | 24 virtual void Run(Delegate* delegate) OVERRIDE; |
24 virtual void Quit() OVERRIDE; | 25 virtual void Quit() OVERRIDE; |
25 virtual void ScheduleWork() OVERRIDE; | 26 virtual void ScheduleWork() OVERRIDE; |
26 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE; | 27 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE; |
27 | 28 |
28 virtual void Start(Delegate* delegate); | 29 virtual void Start(Delegate* delegate); |
29 | 30 |
30 static bool RegisterBindings(JNIEnv* env); | 31 static bool RegisterBindings(JNIEnv* env); |
31 | 32 |
32 protected: | 33 protected: |
33 virtual ~MessagePumpForUI(); | 34 virtual ~MessagePumpForUI(); |
34 | 35 |
35 private: | 36 private: |
36 base::RunLoop* run_loop_; | 37 base::RunLoop* run_loop_; |
37 | 38 |
38 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); | 39 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); |
39 }; | 40 }; |
40 | 41 |
41 } // namespace base | 42 } // namespace base |
42 | 43 |
43 #endif // BASE_MESSAGE_PUMP_ANDROID_H_ | 44 #endif // BASE_MESSAGE_PUMP_ANDROID_H_ |
OLD | NEW |