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
3 // found in the LICENSE file.
5 #ifndef CONTENT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_
6 #define CONTENT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_
8 #include "base/threading/thread_local_storage.h"
9 #include "content/child/webfallbackthemeengine_impl.h"
10 #include "content/common/content_export.h"
11 #include "webkit/child/webkit_child_export.h"
12 #include "webkit/child/webkitplatformsupport_impl.h"
14 #if defined(USE_DEFAULT_RENDER_THEME)
15 #include "content/child/webthemeengine_impl_default.h"
17 #include "content/child/webthemeengine_impl_win.h"
18 #elif defined(OS_MACOSX)
19 #include "content/child/webthemeengine_impl_mac.h"
20 #elif defined(OS_ANDROID)
21 #include "content/child/webthemeengine_impl_android.h"
24 namespace webkit_glue {
25 class FlingCurveConfiguration;
30 class CONTENT_EXPORT WebKitPlatformSupportChildImpl :
31 public webkit_glue::WebKitPlatformSupportImpl {
33 WebKitPlatformSupportChildImpl();
34 virtual ~WebKitPlatformSupportChildImpl();
36 // Platform methods (partial implementation):
37 virtual blink::WebThemeEngine* themeEngine();
38 virtual blink::WebFallbackThemeEngine* fallbackThemeEngine();
40 void SetFlingCurveParameters(
41 const std::vector<float>& new_touchpad,
42 const std::vector<float>& new_touchscreen);
44 virtual blink::WebGestureCurve* createFlingAnimationCurve(
46 const blink::WebFloatPoint& velocity,
47 const blink::WebSize& cumulative_scroll) OVERRIDE;
49 virtual blink::WebThread* createThread(const char* name);
50 virtual blink::WebThread* currentThread();
52 virtual blink::WebWaitableEvent* createWaitableEvent();
53 virtual blink::WebWaitableEvent* waitMultipleEvents(
54 const blink::WebVector<blink::WebWaitableEvent*>& events);
56 virtual void didStartWorkerRunLoop(
57 const blink::WebWorkerRunLoop& runLoop) OVERRIDE;
58 virtual void didStopWorkerRunLoop(
59 const blink::WebWorkerRunLoop& runLoop) OVERRIDE;
61 virtual blink::WebDiscardableMemory* allocateAndLockDiscardableMemory(
65 static void DestroyCurrentThread(void*);
67 WebThemeEngineImpl native_theme_engine_;
68 WebFallbackThemeEngineImpl fallback_theme_engine_;
69 base::ThreadLocalStorage::Slot current_thread_slot_;
70 scoped_ptr<webkit_glue::FlingCurveConfiguration> fling_curve_configuration_;
73 } // namespace content
75 #endif // CONTENT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_