| 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 23 matching lines...) Expand all Loading... |
| 34 class WebGraphicsContext3DProvider; | 34 class WebGraphicsContext3DProvider; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace content { | 37 namespace content { |
| 38 class BatteryStatusDispatcher; | 38 class BatteryStatusDispatcher; |
| 39 class DeviceMotionEventPump; | 39 class DeviceMotionEventPump; |
| 40 class DeviceOrientationEventPump; | 40 class DeviceOrientationEventPump; |
| 41 class QuotaMessageFilter; | 41 class QuotaMessageFilter; |
| 42 class RendererClipboardClient; | 42 class RendererClipboardClient; |
| 43 class RenderView; | 43 class RenderView; |
| 44 class RendererGamepadProvider; |
| 44 class ThreadSafeSender; | 45 class ThreadSafeSender; |
| 45 class WebClipboardImpl; | 46 class WebClipboardImpl; |
| 46 class WebDatabaseObserverImpl; | 47 class WebDatabaseObserverImpl; |
| 47 class WebFileSystemImpl; | 48 class WebFileSystemImpl; |
| 48 | 49 |
| 49 class CONTENT_EXPORT RendererWebKitPlatformSupportImpl | 50 class CONTENT_EXPORT RendererWebKitPlatformSupportImpl |
| 50 : public BlinkPlatformImpl { | 51 : public BlinkPlatformImpl { |
| 51 public: | 52 public: |
| 52 RendererWebKitPlatformSupportImpl(); | 53 RendererWebKitPlatformSupportImpl(); |
| 53 virtual ~RendererWebKitPlatformSupportImpl(); | 54 virtual ~RendererWebKitPlatformSupportImpl(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 blink::WebDeviceOrientationListener* listener); | 142 blink::WebDeviceOrientationListener* listener); |
| 142 virtual void queryStorageUsageAndQuota( | 143 virtual void queryStorageUsageAndQuota( |
| 143 const blink::WebURL& storage_partition, | 144 const blink::WebURL& storage_partition, |
| 144 blink::WebStorageQuotaType, | 145 blink::WebStorageQuotaType, |
| 145 blink::WebStorageQuotaCallbacks); | 146 blink::WebStorageQuotaCallbacks); |
| 146 virtual void vibrate(unsigned int milliseconds); | 147 virtual void vibrate(unsigned int milliseconds); |
| 147 virtual void cancelVibration(); | 148 virtual void cancelVibration(); |
| 148 virtual void setBatteryStatusListener( | 149 virtual void setBatteryStatusListener( |
| 149 blink::WebBatteryStatusListener* listener); | 150 blink::WebBatteryStatusListener* listener); |
| 150 | 151 |
| 152 void set_gamepad_provider(RendererGamepadProvider* provider) { |
| 153 gamepad_provider_ = provider; |
| 154 } |
| 155 |
| 151 // Disables the WebSandboxSupport implementation for testing. | 156 // Disables the WebSandboxSupport implementation for testing. |
| 152 // Tests that do not set up a full sandbox environment should call | 157 // Tests that do not set up a full sandbox environment should call |
| 153 // SetSandboxEnabledForTesting(false) _before_ creating any instances | 158 // SetSandboxEnabledForTesting(false) _before_ creating any instances |
| 154 // of this class, to ensure that we don't attempt to use sandbox-related | 159 // of this class, to ensure that we don't attempt to use sandbox-related |
| 155 // file descriptors or other resources. | 160 // file descriptors or other resources. |
| 156 // | 161 // |
| 157 // Returns the previous |enable| value. | 162 // Returns the previous |enable| value. |
| 158 static bool SetSandboxEnabledForTesting(bool enable); | 163 static bool SetSandboxEnabledForTesting(bool enable); |
| 159 | 164 |
| 160 // Set WebGamepads to return when sampleGamepads() is invoked. | |
| 161 static void SetMockGamepadsForTesting(const blink::WebGamepads& pads); | |
| 162 | |
| 163 // Notifies blink::WebGamepadListener about a new gamepad if a listener | |
| 164 // has been set via setGamepadListener. | |
| 165 static void MockGamepadConnected(int index, const blink::WebGamepad& pad); | |
| 166 | |
| 167 // Notifies blink::WebGamepadListener that a gamepad has been disconnected if | |
| 168 // a listener has been set via setGamepadListener. | |
| 169 static void MockGamepadDisconnected(int index, const blink::WebGamepad& pad); | |
| 170 | |
| 171 // Set WebDeviceMotionData to return when setDeviceMotionListener is invoked. | 165 // Set WebDeviceMotionData to return when setDeviceMotionListener is invoked. |
| 172 static void SetMockDeviceMotionDataForTesting( | 166 static void SetMockDeviceMotionDataForTesting( |
| 173 const blink::WebDeviceMotionData& data); | 167 const blink::WebDeviceMotionData& data); |
| 174 // Set WebDeviceOrientationData to return when setDeviceOrientationListener | 168 // Set WebDeviceOrientationData to return when setDeviceOrientationListener |
| 175 // is invoked. | 169 // is invoked. |
| 176 static void SetMockDeviceOrientationDataForTesting( | 170 static void SetMockDeviceOrientationDataForTesting( |
| 177 const blink::WebDeviceOrientationData& data); | 171 const blink::WebDeviceOrientationData& data); |
| 178 // Forces the screen orientation for testing purposes. | 172 // Forces the screen orientation for testing purposes. |
| 179 static void SetMockScreenOrientationForTesting( | 173 static void SetMockScreenOrientationForTesting( |
| 180 RenderView* render_view, | 174 RenderView* render_view, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 scoped_refptr<QuotaMessageFilter> quota_message_filter_; | 223 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
| 230 | 224 |
| 231 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; | 225 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; |
| 232 | 226 |
| 233 WebCompositorSupportImpl compositor_support_; | 227 WebCompositorSupportImpl compositor_support_; |
| 234 | 228 |
| 235 scoped_ptr<blink::WebScrollbarBehavior> web_scrollbar_behavior_; | 229 scoped_ptr<blink::WebScrollbarBehavior> web_scrollbar_behavior_; |
| 236 | 230 |
| 237 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; | 231 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; |
| 238 | 232 |
| 233 RendererGamepadProvider* gamepad_provider_; |
| 234 |
| 239 DISALLOW_COPY_AND_ASSIGN(RendererWebKitPlatformSupportImpl); | 235 DISALLOW_COPY_AND_ASSIGN(RendererWebKitPlatformSupportImpl); |
| 240 }; | 236 }; |
| 241 | 237 |
| 242 } // namespace content | 238 } // namespace content |
| 243 | 239 |
| 244 #endif // CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ | 240 #endif // CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ |
| OLD | NEW |