Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / content / child / webkitplatformsupport_child_impl.h
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.
4
5 #ifndef CONTENT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_
6 #define CONTENT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_
7
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"
13
14 #if defined(USE_DEFAULT_RENDER_THEME)
15 #include "content/child/webthemeengine_impl_default.h"
16 #elif defined(OS_WIN)
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"
22 #endif
23
24 namespace webkit_glue {
25 class FlingCurveConfiguration;
26 }
27
28 namespace content {
29
30 class CONTENT_EXPORT WebKitPlatformSupportChildImpl :
31     public webkit_glue::WebKitPlatformSupportImpl {
32  public:
33   WebKitPlatformSupportChildImpl();
34   virtual ~WebKitPlatformSupportChildImpl();
35
36   // Platform methods (partial implementation):
37   virtual blink::WebThemeEngine* themeEngine();
38   virtual blink::WebFallbackThemeEngine* fallbackThemeEngine();
39
40   void SetFlingCurveParameters(
41     const std::vector<float>& new_touchpad,
42     const std::vector<float>& new_touchscreen);
43
44   virtual blink::WebGestureCurve* createFlingAnimationCurve(
45       int device_source,
46       const blink::WebFloatPoint& velocity,
47       const blink::WebSize& cumulative_scroll) OVERRIDE;
48
49   virtual blink::WebThread* createThread(const char* name);
50   virtual blink::WebThread* currentThread();
51
52   virtual blink::WebWaitableEvent* createWaitableEvent();
53   virtual blink::WebWaitableEvent* waitMultipleEvents(
54       const blink::WebVector<blink::WebWaitableEvent*>& events);
55
56   virtual void didStartWorkerRunLoop(
57       const blink::WebWorkerRunLoop& runLoop) OVERRIDE;
58   virtual void didStopWorkerRunLoop(
59       const blink::WebWorkerRunLoop& runLoop) OVERRIDE;
60
61   virtual blink::WebDiscardableMemory* allocateAndLockDiscardableMemory(
62       size_t bytes);
63
64  private:
65   static void DestroyCurrentThread(void*);
66
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_;
71 };
72
73 }  // namespace content
74
75 #endif  // CONTENT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_