OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 Widget::hide(); | 180 Widget::hide(); |
181 } | 181 } |
182 | 182 |
183 void WebPluginContainerImpl::handleEvent(Event* event) | 183 void WebPluginContainerImpl::handleEvent(Event* event) |
184 { | 184 { |
185 if (!m_webPlugin->acceptsInputEvents()) | 185 if (!m_webPlugin->acceptsInputEvents()) |
186 return; | 186 return; |
187 | 187 |
188 const WebInputEvent* currentInputEvent = WebViewImpl::currentInputEvent(); | 188 const WebInputEvent* currentInputEvent = WebViewImpl::currentInputEvent(); |
189 UserGestureIndicator gestureIndicator(currentInputEvent && WebInputEvent::is
UserGestureEventType(currentInputEvent->type) ? DefinitelyProcessingUserGesture
: PossiblyProcessingUserGesture); | 189 UserGestureIndicator gestureIndicator(currentInputEvent && WebInputEvent::is
UserGestureEventType(currentInputEvent->type) ? DefinitelyProcessingNewUserGestu
re : PossiblyProcessingUserGesture); |
190 | 190 |
191 RefPtr<WebPluginContainerImpl> protector(this); | 191 RefPtr<WebPluginContainerImpl> protector(this); |
192 // The events we pass are defined at: | 192 // The events we pass are defined at: |
193 // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/struct
ures5.html#1000000 | 193 // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/struct
ures5.html#1000000 |
194 // Don't take the documentation as truth, however. There are many cases | 194 // Don't take the documentation as truth, however. There are many cases |
195 // where mozilla behaves differently than the spec. | 195 // where mozilla behaves differently than the spec. |
196 if (event->isMouseEvent()) | 196 if (event->isMouseEvent()) |
197 handleMouseEvent(static_cast<MouseEvent*>(event)); | 197 handleMouseEvent(static_cast<MouseEvent*>(event)); |
198 else if (event->hasInterface(eventNames().interfaceForWheelEvent)) | 198 else if (event->hasInterface(eventNames().interfaceForWheelEvent)) |
199 handleWheelEvent(static_cast<WheelEvent*>(event)); | 199 handleWheelEvent(static_cast<WheelEvent*>(event)); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 // FIXME: This is a bit of hack to allow us to observe completion of | 438 // FIXME: This is a bit of hack to allow us to observe completion of |
439 // our frame request. It would be better to evolve FrameLoader to | 439 // our frame request. It would be better to evolve FrameLoader to |
440 // support a completion callback instead. | 440 // support a completion callback instead. |
441 OwnPtr<WebPluginLoadObserver> observer = adoptPtr(new WebPluginLoadObser
ver(this, request.url(), notifyData)); | 441 OwnPtr<WebPluginLoadObserver> observer = adoptPtr(new WebPluginLoadObser
ver(this, request.url(), notifyData)); |
442 // FIXME: Calling get here is dangerous! What if observer is freed? | 442 // FIXME: Calling get here is dangerous! What if observer is freed? |
443 m_pluginLoadObservers.append(observer.get()); | 443 m_pluginLoadObservers.append(observer.get()); |
444 WebDataSourceImpl::setNextPluginLoadObserver(observer.release()); | 444 WebDataSourceImpl::setNextPluginLoadObserver(observer.release()); |
445 } | 445 } |
446 | 446 |
447 FrameLoadRequest frameRequest(frame->document()->securityOrigin(), request.t
oResourceRequest(), target); | 447 FrameLoadRequest frameRequest(frame->document()->securityOrigin(), request.t
oResourceRequest(), target); |
448 UserGestureIndicator gestureIndicator(request.hasUserGesture() ? DefinitelyP
rocessingUserGesture : PossiblyProcessingUserGesture); | 448 UserGestureIndicator gestureIndicator(request.hasUserGesture() ? DefinitelyP
rocessingNewUserGesture : PossiblyProcessingUserGesture); |
449 frame->loader()->loadFrameRequest(frameRequest, false, false, 0, 0, MaybeSen
dReferrer); | 449 frame->loader()->loadFrameRequest(frameRequest, false, false, 0, 0, MaybeSen
dReferrer); |
450 } | 450 } |
451 | 451 |
452 void WebPluginContainerImpl::zoomLevelChanged(double zoomLevel) | 452 void WebPluginContainerImpl::zoomLevelChanged(double zoomLevel) |
453 { | 453 { |
454 WebViewImpl* view = WebViewImpl::fromPage(m_element->document()->frame()->pa
ge()); | 454 WebViewImpl* view = WebViewImpl::fromPage(m_element->document()->frame()->pa
ge()); |
455 view->fullFramePluginZoomLevelChanged(zoomLevel); | 455 view->fullFramePluginZoomLevelChanged(zoomLevel); |
456 } | 456 } |
457 | 457 |
458 bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect) | 458 bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect) |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 // Take our element and get the clip rect from the enclosing layer and | 852 // Take our element and get the clip rect from the enclosing layer and |
853 // frame view. | 853 // frame view. |
854 clipRect.intersect( | 854 clipRect.intersect( |
855 m_element->document()->view()->windowClipRectForFrameOwner(m_element
, true)); | 855 m_element->document()->view()->windowClipRectForFrameOwner(m_element
, true)); |
856 } | 856 } |
857 | 857 |
858 return clipRect; | 858 return clipRect; |
859 } | 859 } |
860 | 860 |
861 } // namespace WebKit | 861 } // namespace WebKit |
OLD | NEW |