| 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 27 matching lines...) Expand all Loading... |
| 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 RenderView; | 46 class RenderView; |
| 47 class ThreadSafeSender; | 47 class ThreadSafeSender; |
| 48 class WebBluetoothImpl; |
| 48 class WebClipboardImpl; | 49 class WebClipboardImpl; |
| 49 class WebDatabaseObserverImpl; | 50 class WebDatabaseObserverImpl; |
| 50 class WebFileSystemImpl; | 51 class WebFileSystemImpl; |
| 51 | 52 |
| 52 class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { | 53 class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { |
| 53 public: | 54 public: |
| 54 RendererBlinkPlatformImpl(); | 55 RendererBlinkPlatformImpl(); |
| 55 virtual ~RendererBlinkPlatformImpl(); | 56 virtual ~RendererBlinkPlatformImpl(); |
| 56 | 57 |
| 57 void set_plugin_refresh_allowed(bool plugin_refresh_allowed) { | 58 void set_plugin_refresh_allowed(bool plugin_refresh_allowed) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 virtual blink::WebCompositorSupport* compositorSupport(); | 141 virtual blink::WebCompositorSupport* compositorSupport(); |
| 141 virtual blink::WebString convertIDNToUnicode( | 142 virtual blink::WebString convertIDNToUnicode( |
| 142 const blink::WebString& host, const blink::WebString& languages); | 143 const blink::WebString& host, const blink::WebString& languages); |
| 143 virtual void startListening(blink::WebPlatformEventType, | 144 virtual void startListening(blink::WebPlatformEventType, |
| 144 blink::WebPlatformEventListener*); | 145 blink::WebPlatformEventListener*); |
| 145 virtual void stopListening(blink::WebPlatformEventType); | 146 virtual void stopListening(blink::WebPlatformEventType); |
| 146 virtual void queryStorageUsageAndQuota( | 147 virtual void queryStorageUsageAndQuota( |
| 147 const blink::WebURL& storage_partition, | 148 const blink::WebURL& storage_partition, |
| 148 blink::WebStorageQuotaType, | 149 blink::WebStorageQuotaType, |
| 149 blink::WebStorageQuotaCallbacks); | 150 blink::WebStorageQuotaCallbacks); |
| 151 virtual blink::WebBluetooth* bluetooth(); |
| 150 virtual void vibrate(unsigned int milliseconds); | 152 virtual void vibrate(unsigned int milliseconds); |
| 151 virtual void cancelVibration(); | 153 virtual void cancelVibration(); |
| 152 | 154 |
| 153 // Set the PlatformEventObserverBase in |platform_event_observers_| associated | 155 // Set the PlatformEventObserverBase in |platform_event_observers_| associated |
| 154 // with |type| to |observer|. If there was already an observer associated to | 156 // with |type| to |observer|. If there was already an observer associated to |
| 155 // the given |type|, it will be replaced. | 157 // the given |type|, it will be replaced. |
| 156 // Note that |observer| will be owned by this object after the call. | 158 // Note that |observer| will be owned by this object after the call. |
| 157 void SetPlatformEventObserverForTesting( | 159 void SetPlatformEventObserverForTesting( |
| 158 blink::WebPlatformEventType type, | 160 blink::WebPlatformEventType type, |
| 159 scoped_ptr<PlatformEventObserverBase> observer); | 161 scoped_ptr<PlatformEventObserverBase> observer); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 178 const blink::WebDeviceOrientationData& data); | 180 const blink::WebDeviceOrientationData& data); |
| 179 | 181 |
| 180 // Notifies blink::WebBatteryStatusListener that battery status has changed. | 182 // Notifies blink::WebBatteryStatusListener that battery status has changed. |
| 181 void MockBatteryStatusChangedForTesting( | 183 void MockBatteryStatusChangedForTesting( |
| 182 const blink::WebBatteryStatus& status); | 184 const blink::WebBatteryStatus& status); |
| 183 | 185 |
| 184 WebDatabaseObserverImpl* web_database_observer_impl() { | 186 WebDatabaseObserverImpl* web_database_observer_impl() { |
| 185 return web_database_observer_impl_.get(); | 187 return web_database_observer_impl_.get(); |
| 186 } | 188 } |
| 187 | 189 |
| 190 WebBluetoothImpl* BluetoothImplForTesting() { return bluetooth_.get(); } |
| 191 |
| 188 private: | 192 private: |
| 189 bool CheckPreparsedJsCachingEnabled() const; | 193 bool CheckPreparsedJsCachingEnabled() const; |
| 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. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 scoped_refptr<QuotaMessageFilter> quota_message_filter_; | 238 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
| 235 | 239 |
| 236 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; | 240 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; |
| 237 | 241 |
| 238 cc_blink::WebCompositorSupportImpl compositor_support_; | 242 cc_blink::WebCompositorSupportImpl compositor_support_; |
| 239 | 243 |
| 240 scoped_ptr<blink::WebScrollbarBehavior> web_scrollbar_behavior_; | 244 scoped_ptr<blink::WebScrollbarBehavior> web_scrollbar_behavior_; |
| 241 | 245 |
| 242 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; | 246 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; |
| 243 | 247 |
| 248 scoped_ptr<WebBluetoothImpl> bluetooth_; |
| 249 |
| 244 IDMap<PlatformEventObserverBase, IDMapOwnPointer> platform_event_observers_; | 250 IDMap<PlatformEventObserverBase, IDMapOwnPointer> platform_event_observers_; |
| 245 | 251 |
| 246 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); | 252 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); |
| 247 }; | 253 }; |
| 248 | 254 |
| 249 } // namespace content | 255 } // namespace content |
| 250 | 256 |
| 251 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ | 257 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |
| OLD | NEW |