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 CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/child/blink_platform_impl.h" | 10 #include "content/child/blink_platform_impl.h" |
(...skipping 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 class WebBatteryStatus; | 31 class WebBatteryStatus; |
32 class WebDeviceMotionData; | 32 class WebDeviceMotionData; |
33 class WebDeviceOrientationData; | 33 class WebDeviceOrientationData; |
34 class WebGraphicsContext3DProvider; | 34 class WebGraphicsContext3DProvider; |
35 } | 35 } |
36 | 36 |
37 namespace content { | 37 namespace content { |
38 class BatteryStatusDispatcher; | 38 class BatteryStatusDispatcher; |
39 class DeviceLightEventPump; | |
39 class DeviceMotionEventPump; | 40 class DeviceMotionEventPump; |
40 class DeviceOrientationEventPump; | 41 class DeviceOrientationEventPump; |
41 class QuotaMessageFilter; | 42 class QuotaMessageFilter; |
42 class RendererClipboardClient; | 43 class RendererClipboardClient; |
43 class RenderView; | 44 class RenderView; |
44 class RendererGamepadProvider; | 45 class RendererGamepadProvider; |
45 class ThreadSafeSender; | 46 class ThreadSafeSender; |
46 class WebClipboardImpl; | 47 class WebClipboardImpl; |
47 class WebDatabaseObserverImpl; | 48 class WebDatabaseObserverImpl; |
48 class WebFileSystemImpl; | 49 class WebFileSystemImpl; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 virtual blink::WebGraphicsContext3D* createOffscreenGraphicsContext3D( | 130 virtual blink::WebGraphicsContext3D* createOffscreenGraphicsContext3D( |
130 const blink::WebGraphicsContext3D::Attributes& attributes); | 131 const blink::WebGraphicsContext3D::Attributes& attributes); |
131 virtual blink::WebGraphicsContext3D* createOffscreenGraphicsContext3D( | 132 virtual blink::WebGraphicsContext3D* createOffscreenGraphicsContext3D( |
132 const blink::WebGraphicsContext3D::Attributes& attributes, | 133 const blink::WebGraphicsContext3D::Attributes& attributes, |
133 blink::WebGraphicsContext3D* share_context); | 134 blink::WebGraphicsContext3D* share_context); |
134 virtual blink::WebGraphicsContext3DProvider* | 135 virtual blink::WebGraphicsContext3DProvider* |
135 createSharedOffscreenGraphicsContext3DProvider(); | 136 createSharedOffscreenGraphicsContext3DProvider(); |
136 virtual blink::WebCompositorSupport* compositorSupport(); | 137 virtual blink::WebCompositorSupport* compositorSupport(); |
137 virtual blink::WebString convertIDNToUnicode( | 138 virtual blink::WebString convertIDNToUnicode( |
138 const blink::WebString& host, const blink::WebString& languages); | 139 const blink::WebString& host, const blink::WebString& languages); |
140 virtual void setDeviceLightListener(blink::WebDeviceLightListener* listener); | |
139 virtual void setDeviceMotionListener( | 141 virtual void setDeviceMotionListener( |
140 blink::WebDeviceMotionListener* listener); | 142 blink::WebDeviceMotionListener* listener); |
141 virtual void setDeviceOrientationListener( | 143 virtual void setDeviceOrientationListener( |
142 blink::WebDeviceOrientationListener* listener); | 144 blink::WebDeviceOrientationListener* listener); |
143 virtual void queryStorageUsageAndQuota( | 145 virtual void queryStorageUsageAndQuota( |
144 const blink::WebURL& storage_partition, | 146 const blink::WebURL& storage_partition, |
145 blink::WebStorageQuotaType, | 147 blink::WebStorageQuotaType, |
146 blink::WebStorageQuotaCallbacks); | 148 blink::WebStorageQuotaCallbacks); |
147 virtual void vibrate(unsigned int milliseconds); | 149 virtual void vibrate(unsigned int milliseconds); |
148 virtual void cancelVibration(); | 150 virtual void cancelVibration(); |
149 virtual void setBatteryStatusListener( | 151 virtual void setBatteryStatusListener( |
150 blink::WebBatteryStatusListener* listener); | 152 blink::WebBatteryStatusListener* listener); |
151 | 153 |
152 void set_gamepad_provider(RendererGamepadProvider* provider) { | 154 void set_gamepad_provider(RendererGamepadProvider* provider) { |
153 gamepad_provider_ = provider; | 155 gamepad_provider_ = provider; |
154 } | 156 } |
155 | 157 |
156 // Disables the WebSandboxSupport implementation for testing. | 158 // Disables the WebSandboxSupport implementation for testing. |
157 // Tests that do not set up a full sandbox environment should call | 159 // Tests that do not set up a full sandbox environment should call |
158 // SetSandboxEnabledForTesting(false) _before_ creating any instances | 160 // SetSandboxEnabledForTesting(false) _before_ creating any instances |
159 // of this class, to ensure that we don't attempt to use sandbox-related | 161 // of this class, to ensure that we don't attempt to use sandbox-related |
160 // file descriptors or other resources. | 162 // file descriptors or other resources. |
161 // | 163 // |
162 // Returns the previous |enable| value. | 164 // Returns the previous |enable| value. |
163 static bool SetSandboxEnabledForTesting(bool enable); | 165 static bool SetSandboxEnabledForTesting(bool enable); |
164 | 166 |
167 // Set WebGamepads to return when sampleGamepads() is invoked. | |
168 static void SetMockGamepadsForTesting(const blink::WebGamepads& pads); | |
jochen (gone - plz use gerrit)
2014/06/25 13:16:11
not related to this CL?
riju_
2014/06/25 15:53:11
Sorry, my mistake in rebasing. Done.
| |
169 | |
170 // Notifies blink::WebGamepadListener about a new gamepad if a listener | |
171 // has been set via setGamepadListener. | |
172 static void MockGamepadConnected(int index, const blink::WebGamepad& pad); | |
173 | |
174 // Notifies blink::WebGamepadListener that a gamepad has been disconnected if | |
175 // a listener has been set via setGamepadListener. | |
176 static void MockGamepadDisconnected(int index, const blink::WebGamepad& pad); | |
177 | |
178 // Set a double to return when setDeviceLightListener is invoked. | |
179 static void SetMockDeviceLightDataForTesting(double data); | |
jochen (gone - plz use gerrit)
2014/06/25 13:16:11
can you hook this API up to content_shell / test_r
riju_
2014/06/25 15:53:11
I have the layout support patch here.
https://code
| |
165 // Set WebDeviceMotionData to return when setDeviceMotionListener is invoked. | 180 // Set WebDeviceMotionData to return when setDeviceMotionListener is invoked. |
166 static void SetMockDeviceMotionDataForTesting( | 181 static void SetMockDeviceMotionDataForTesting( |
167 const blink::WebDeviceMotionData& data); | 182 const blink::WebDeviceMotionData& data); |
168 // Set WebDeviceOrientationData to return when setDeviceOrientationListener | 183 // Set WebDeviceOrientationData to return when setDeviceOrientationListener |
169 // is invoked. | 184 // is invoked. |
170 static void SetMockDeviceOrientationDataForTesting( | 185 static void SetMockDeviceOrientationDataForTesting( |
171 const blink::WebDeviceOrientationData& data); | 186 const blink::WebDeviceOrientationData& data); |
172 // Forces the screen orientation for testing purposes. | 187 // Forces the screen orientation for testing purposes. |
173 static void SetMockScreenOrientationForTesting( | 188 static void SetMockScreenOrientationForTesting( |
174 RenderView* render_view, | 189 RenderView* render_view, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 | 222 |
208 // If true, then a GetPlugins call is allowed to rescan the disk. | 223 // If true, then a GetPlugins call is allowed to rescan the disk. |
209 bool plugin_refresh_allowed_; | 224 bool plugin_refresh_allowed_; |
210 | 225 |
211 scoped_ptr<blink::WebIDBFactory> web_idb_factory_; | 226 scoped_ptr<blink::WebIDBFactory> web_idb_factory_; |
212 | 227 |
213 scoped_ptr<blink::WebBlobRegistry> blob_registry_; | 228 scoped_ptr<blink::WebBlobRegistry> blob_registry_; |
214 | 229 |
215 WebPublicSuffixListImpl public_suffix_list_; | 230 WebPublicSuffixListImpl public_suffix_list_; |
216 | 231 |
232 scoped_ptr<DeviceLightEventPump> device_light_event_pump_; | |
217 scoped_ptr<DeviceMotionEventPump> device_motion_event_pump_; | 233 scoped_ptr<DeviceMotionEventPump> device_motion_event_pump_; |
218 scoped_ptr<DeviceOrientationEventPump> device_orientation_event_pump_; | 234 scoped_ptr<DeviceOrientationEventPump> device_orientation_event_pump_; |
219 | 235 |
220 scoped_refptr<base::MessageLoopProxy> child_thread_loop_; | 236 scoped_refptr<base::MessageLoopProxy> child_thread_loop_; |
221 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 237 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
222 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 238 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
223 scoped_refptr<QuotaMessageFilter> quota_message_filter_; | 239 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
224 | 240 |
225 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; | 241 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; |
226 | 242 |
227 WebCompositorSupportImpl compositor_support_; | 243 WebCompositorSupportImpl compositor_support_; |
228 | 244 |
229 scoped_ptr<blink::WebScrollbarBehavior> web_scrollbar_behavior_; | 245 scoped_ptr<blink::WebScrollbarBehavior> web_scrollbar_behavior_; |
230 | 246 |
231 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; | 247 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; |
232 | 248 |
233 RendererGamepadProvider* gamepad_provider_; | 249 RendererGamepadProvider* gamepad_provider_; |
234 | 250 |
235 DISALLOW_COPY_AND_ASSIGN(RendererWebKitPlatformSupportImpl); | 251 DISALLOW_COPY_AND_ASSIGN(RendererWebKitPlatformSupportImpl); |
236 }; | 252 }; |
237 | 253 |
238 } // namespace content | 254 } // namespace content |
239 | 255 |
240 #endif // CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ | 256 #endif // CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ |
OLD | NEW |