1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_TEST_NESTED_MESSAGE_PUMP_ANDROID_
6 #define CONTENT_PUBLIC_TEST_NESTED_MESSAGE_PUMP_ANDROID_
8 #include "base/android/jni_android.h"
9 #include "base/compiler_specific.h"
10 #include "base/message_loop/message_pump_android.h"
14 // A nested message pump to be used for content browsertests and layout tests
15 // on Android. It overrides the default UI message pump to allow nested loops.
16 class NestedMessagePumpAndroid
: public base::MessagePumpForUI
{
18 NestedMessagePumpAndroid();
20 virtual void Run(Delegate
* delegate
) OVERRIDE
;
21 virtual void Quit() OVERRIDE
;
22 virtual void ScheduleWork() OVERRIDE
;
23 virtual void ScheduleDelayedWork(
24 const base::TimeTicks
& delayed_work_time
) OVERRIDE
;
25 virtual void Start(Delegate
* delegate
) OVERRIDE
;
27 static bool RegisterJni(JNIEnv
* env
);
30 virtual ~NestedMessagePumpAndroid();
33 // We may make recursive calls to Run, so we save state that needs to be
34 // separate between them in this structure type.
39 DISALLOW_COPY_AND_ASSIGN(NestedMessagePumpAndroid
);
42 } // namespace content
44 #endif // CONTENT_PUBLIC_TEST_NESTED_MESSAGE_PUMP_ANDROID_