| 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_BLINK_PLATFORM_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace content { | 38 namespace content { |
| 39 class BatteryStatusDispatcher; | 39 class BatteryStatusDispatcher; |
| 40 class DeviceLightEventPump; | 40 class DeviceLightEventPump; |
| 41 class DeviceMotionEventPump; | 41 class DeviceMotionEventPump; |
| 42 class DeviceOrientationEventPump; | 42 class DeviceOrientationEventPump; |
| 43 class PlatformEventObserverBase; | 43 class PlatformEventObserverBase; |
| 44 class QuotaMessageFilter; | 44 class QuotaMessageFilter; |
| 45 class RendererClipboardClient; | 45 class RendererClipboardClient; |
| 46 class RendererScheduler; |
| 46 class RenderView; | 47 class RenderView; |
| 47 class ThreadSafeSender; | 48 class ThreadSafeSender; |
| 48 class WebClipboardImpl; | 49 class WebClipboardImpl; |
| 49 class WebDatabaseObserverImpl; | 50 class WebDatabaseObserverImpl; |
| 50 class WebFileSystemImpl; | 51 class WebFileSystemImpl; |
| 52 class WebSchedulerImpl; |
| 51 | 53 |
| 52 class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { | 54 class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { |
| 53 public: | 55 public: |
| 54 RendererBlinkPlatformImpl(); | 56 RendererBlinkPlatformImpl(RendererScheduler* renderer_scheduler); |
| 55 virtual ~RendererBlinkPlatformImpl(); | 57 virtual ~RendererBlinkPlatformImpl(); |
| 56 | 58 |
| 57 void set_plugin_refresh_allowed(bool plugin_refresh_allowed) { | 59 void set_plugin_refresh_allowed(bool plugin_refresh_allowed) { |
| 58 plugin_refresh_allowed_ = plugin_refresh_allowed; | 60 plugin_refresh_allowed_ = plugin_refresh_allowed; |
| 59 } | 61 } |
| 60 // Platform methods: | 62 // Platform methods: |
| 63 virtual void callOnMainThread(void (*func)(void*), void* context); |
| 61 virtual blink::WebClipboard* clipboard(); | 64 virtual blink::WebClipboard* clipboard(); |
| 62 virtual blink::WebMimeRegistry* mimeRegistry(); | 65 virtual blink::WebMimeRegistry* mimeRegistry(); |
| 63 virtual blink::WebFileUtilities* fileUtilities(); | 66 virtual blink::WebFileUtilities* fileUtilities(); |
| 64 virtual blink::WebSandboxSupport* sandboxSupport(); | 67 virtual blink::WebSandboxSupport* sandboxSupport(); |
| 65 virtual blink::WebCookieJar* cookieJar(); | 68 virtual blink::WebCookieJar* cookieJar(); |
| 66 virtual blink::WebThemeEngine* themeEngine(); | 69 virtual blink::WebThemeEngine* themeEngine(); |
| 67 virtual blink::WebSpeechSynthesizer* createSpeechSynthesizer( | 70 virtual blink::WebSpeechSynthesizer* createSpeechSynthesizer( |
| 68 blink::WebSpeechSynthesizerClient* client); | 71 blink::WebSpeechSynthesizerClient* client); |
| 69 virtual bool sandboxEnabled(); | 72 virtual bool sandboxEnabled(); |
| 70 virtual unsigned long long visitedLinkHash( | 73 virtual unsigned long long visitedLinkHash( |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 const blink::WebString& host, const blink::WebString& languages); | 145 const blink::WebString& host, const blink::WebString& languages); |
| 143 virtual void startListening(blink::WebPlatformEventType, | 146 virtual void startListening(blink::WebPlatformEventType, |
| 144 blink::WebPlatformEventListener*); | 147 blink::WebPlatformEventListener*); |
| 145 virtual void stopListening(blink::WebPlatformEventType); | 148 virtual void stopListening(blink::WebPlatformEventType); |
| 146 virtual void queryStorageUsageAndQuota( | 149 virtual void queryStorageUsageAndQuota( |
| 147 const blink::WebURL& storage_partition, | 150 const blink::WebURL& storage_partition, |
| 148 blink::WebStorageQuotaType, | 151 blink::WebStorageQuotaType, |
| 149 blink::WebStorageQuotaCallbacks); | 152 blink::WebStorageQuotaCallbacks); |
| 150 virtual void vibrate(unsigned int milliseconds); | 153 virtual void vibrate(unsigned int milliseconds); |
| 151 virtual void cancelVibration(); | 154 virtual void cancelVibration(); |
| 155 virtual blink::WebScheduler* scheduler(); |
| 152 | 156 |
| 153 // Set the PlatformEventObserverBase in |platform_event_observers_| associated | 157 // Set the PlatformEventObserverBase in |platform_event_observers_| associated |
| 154 // with |type| to |observer|. If there was already an observer associated to | 158 // with |type| to |observer|. If there was already an observer associated to |
| 155 // the given |type|, it will be replaced. | 159 // the given |type|, it will be replaced. |
| 156 // Note that |observer| will be owned by this object after the call. | 160 // Note that |observer| will be owned by this object after the call. |
| 157 void SetPlatformEventObserverForTesting( | 161 void SetPlatformEventObserverForTesting( |
| 158 blink::WebPlatformEventType type, | 162 blink::WebPlatformEventType type, |
| 159 scoped_ptr<PlatformEventObserverBase> observer); | 163 scoped_ptr<PlatformEventObserverBase> observer); |
| 160 | 164 |
| 161 // Disables the WebSandboxSupport implementation for testing. | 165 // Disables the WebSandboxSupport implementation for testing. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 190 | 194 |
| 191 // Factory that takes a type and return PlatformEventObserverBase that matches | 195 // Factory that takes a type and return PlatformEventObserverBase that matches |
| 192 // it. | 196 // it. |
| 193 static PlatformEventObserverBase* CreatePlatformEventObserverFromType( | 197 static PlatformEventObserverBase* CreatePlatformEventObserverFromType( |
| 194 blink::WebPlatformEventType type); | 198 blink::WebPlatformEventType type); |
| 195 | 199 |
| 196 // Use the data previously set via SetMockDevice...DataForTesting() and send | 200 // Use the data previously set via SetMockDevice...DataForTesting() and send |
| 197 // them to the registered listener. | 201 // them to the registered listener. |
| 198 void SendFakeDeviceEventDataForTesting(blink::WebPlatformEventType type); | 202 void SendFakeDeviceEventDataForTesting(blink::WebPlatformEventType type); |
| 199 | 203 |
| 204 scoped_ptr<WebSchedulerImpl> web_scheduler_; |
| 205 |
| 200 scoped_ptr<RendererClipboardClient> clipboard_client_; | 206 scoped_ptr<RendererClipboardClient> clipboard_client_; |
| 201 scoped_ptr<WebClipboardImpl> clipboard_; | 207 scoped_ptr<WebClipboardImpl> clipboard_; |
| 202 | 208 |
| 203 class FileUtilities; | 209 class FileUtilities; |
| 204 scoped_ptr<FileUtilities> file_utilities_; | 210 scoped_ptr<FileUtilities> file_utilities_; |
| 205 | 211 |
| 206 class MimeRegistry; | 212 class MimeRegistry; |
| 207 scoped_ptr<MimeRegistry> mime_registry_; | 213 scoped_ptr<MimeRegistry> mime_registry_; |
| 208 | 214 |
| 209 class SandboxSupport; | 215 class SandboxSupport; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 221 scoped_ptr<blink::WebIDBFactory> web_idb_factory_; | 227 scoped_ptr<blink::WebIDBFactory> web_idb_factory_; |
| 222 | 228 |
| 223 scoped_ptr<blink::WebBlobRegistry> blob_registry_; | 229 scoped_ptr<blink::WebBlobRegistry> blob_registry_; |
| 224 | 230 |
| 225 WebPublicSuffixListImpl public_suffix_list_; | 231 WebPublicSuffixListImpl public_suffix_list_; |
| 226 | 232 |
| 227 scoped_ptr<DeviceLightEventPump> device_light_event_pump_; | 233 scoped_ptr<DeviceLightEventPump> device_light_event_pump_; |
| 228 scoped_ptr<DeviceMotionEventPump> device_motion_event_pump_; | 234 scoped_ptr<DeviceMotionEventPump> device_motion_event_pump_; |
| 229 scoped_ptr<DeviceOrientationEventPump> device_orientation_event_pump_; | 235 scoped_ptr<DeviceOrientationEventPump> device_orientation_event_pump_; |
| 230 | 236 |
| 237 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; |
| 231 scoped_refptr<base::MessageLoopProxy> child_thread_loop_; | 238 scoped_refptr<base::MessageLoopProxy> child_thread_loop_; |
| 232 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 239 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
| 233 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 240 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 234 scoped_refptr<QuotaMessageFilter> quota_message_filter_; | 241 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
| 235 | 242 |
| 236 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; | 243 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; |
| 237 | 244 |
| 238 cc_blink::WebCompositorSupportImpl compositor_support_; | 245 cc_blink::WebCompositorSupportImpl compositor_support_; |
| 239 | 246 |
| 240 scoped_ptr<blink::WebScrollbarBehavior> web_scrollbar_behavior_; | 247 scoped_ptr<blink::WebScrollbarBehavior> web_scrollbar_behavior_; |
| 241 | 248 |
| 242 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; | 249 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; |
| 243 | 250 |
| 244 IDMap<PlatformEventObserverBase, IDMapOwnPointer> platform_event_observers_; | 251 IDMap<PlatformEventObserverBase, IDMapOwnPointer> platform_event_observers_; |
| 245 | 252 |
| 246 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); | 253 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); |
| 247 }; | 254 }; |
| 248 | 255 |
| 249 } // namespace content | 256 } // namespace content |
| 250 | 257 |
| 251 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ | 258 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |
| OLD | NEW |