| 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(); |
| 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 16 matching lines...) Expand all Loading... |
| 178 const blink::WebDeviceOrientationData& data); | 182 const blink::WebDeviceOrientationData& data); |
| 179 | 183 |
| 180 // Notifies blink::WebBatteryStatusListener that battery status has changed. | 184 // Notifies blink::WebBatteryStatusListener that battery status has changed. |
| 181 void MockBatteryStatusChangedForTesting( | 185 void MockBatteryStatusChangedForTesting( |
| 182 const blink::WebBatteryStatus& status); | 186 const blink::WebBatteryStatus& status); |
| 183 | 187 |
| 184 WebDatabaseObserverImpl* web_database_observer_impl() { | 188 WebDatabaseObserverImpl* web_database_observer_impl() { |
| 185 return web_database_observer_impl_.get(); | 189 return web_database_observer_impl_.get(); |
| 186 } | 190 } |
| 187 | 191 |
| 192 RendererScheduler* renderer_scheduler() { return renderer_scheduler_.get(); } |
| 193 |
| 188 private: | 194 private: |
| 189 bool CheckPreparsedJsCachingEnabled() const; | 195 bool CheckPreparsedJsCachingEnabled() const; |
| 190 | 196 |
| 191 // Factory that takes a type and return PlatformEventObserverBase that matches | 197 // Factory that takes a type and return PlatformEventObserverBase that matches |
| 192 // it. | 198 // it. |
| 193 static PlatformEventObserverBase* CreatePlatformEventObserverFromType( | 199 static PlatformEventObserverBase* CreatePlatformEventObserverFromType( |
| 194 blink::WebPlatformEventType type); | 200 blink::WebPlatformEventType type); |
| 195 | 201 |
| 196 // Use the data previously set via SetMockDevice...DataForTesting() and send | 202 // Use the data previously set via SetMockDevice...DataForTesting() and send |
| 197 // them to the registered listener. | 203 // them to the registered listener. |
| 198 void SendFakeDeviceEventDataForTesting(blink::WebPlatformEventType type); | 204 void SendFakeDeviceEventDataForTesting(blink::WebPlatformEventType type); |
| 199 | 205 |
| 206 scoped_ptr<RendererScheduler> renderer_scheduler_; |
| 207 scoped_ptr<WebSchedulerImpl> web_scheduler_; |
| 208 |
| 200 scoped_ptr<RendererClipboardClient> clipboard_client_; | 209 scoped_ptr<RendererClipboardClient> clipboard_client_; |
| 201 scoped_ptr<WebClipboardImpl> clipboard_; | 210 scoped_ptr<WebClipboardImpl> clipboard_; |
| 202 | 211 |
| 203 class FileUtilities; | 212 class FileUtilities; |
| 204 scoped_ptr<FileUtilities> file_utilities_; | 213 scoped_ptr<FileUtilities> file_utilities_; |
| 205 | 214 |
| 206 class MimeRegistry; | 215 class MimeRegistry; |
| 207 scoped_ptr<MimeRegistry> mime_registry_; | 216 scoped_ptr<MimeRegistry> mime_registry_; |
| 208 | 217 |
| 209 class SandboxSupport; | 218 class SandboxSupport; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; | 251 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; |
| 243 | 252 |
| 244 IDMap<PlatformEventObserverBase, IDMapOwnPointer> platform_event_observers_; | 253 IDMap<PlatformEventObserverBase, IDMapOwnPointer> platform_event_observers_; |
| 245 | 254 |
| 246 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); | 255 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); |
| 247 }; | 256 }; |
| 248 | 257 |
| 249 } // namespace content | 258 } // namespace content |
| 250 | 259 |
| 251 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ | 260 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |
| OLD | NEW |