diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-01-11 10:03:25 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-01-11 10:03:25 +0100 |
commit | d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (patch) | |
tree | b318cf594dc1da2fa48224005945c9157f35bb41 /Source/WebKit/chromium/src/WebViewImpl.cpp | |
parent | 6300a96eca9f152b379f1bcf3d9efdc5572d989a (diff) | |
download | qtwebkit-d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9.tar.gz |
Imported WebKit commit 75bb2fc5882d2e1b3d5572c2961507996cbca5e3 (http://svn.webkit.org/repository/webkit/trunk@104681)
Diffstat (limited to 'Source/WebKit/chromium/src/WebViewImpl.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/WebViewImpl.cpp | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index b9355fc83..a14748353 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Google Inc. All rights reserved. + * Copyright (C) 2011, 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -95,6 +95,7 @@ #include "ProgressTracker.h" #include "RenderLayerCompositor.h" #include "RenderView.h" +#include "RenderWidget.h" #include "ResourceHandle.h" #include "SchemeRegistry.h" #include "ScrollAnimator.h" @@ -125,6 +126,7 @@ #include "WebMediaPlayerAction.h" #include "WebNode.h" #include "WebPlugin.h" +#include "WebPluginAction.h" #include "WebPluginContainerImpl.h" #include "platform/WebPoint.h" #include "WebPopupMenuImpl.h" @@ -2183,7 +2185,7 @@ void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action, HitTestResult result = hitTestResultForWindowPos(location); RefPtr<Node> node = result.innerNonSharedNode(); if (!node->hasTagName(HTMLNames::videoTag) && !node->hasTagName(HTMLNames::audioTag)) - return; + return; RefPtr<HTMLMediaElement> mediaElement = static_pointer_cast<HTMLMediaElement>(node); @@ -2208,6 +2210,33 @@ void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action, } } +void WebViewImpl::performPluginAction(const WebPluginAction& action, + const WebPoint& location) +{ + HitTestResult result = hitTestResultForWindowPos(location); + RefPtr<Node> node = result.innerNonSharedNode(); + if (!node->hasTagName(HTMLNames::objectTag) && !node->hasTagName(HTMLNames::embedTag)) + return; + + RenderObject* object = node->renderer(); + if (object && object->isWidget()) { + Widget* widget = toRenderWidget(object)->widget(); + if (widget && widget->isPluginContainer()) { + WebPluginContainerImpl* plugin = static_cast<WebPluginContainerImpl*>(widget); + switch (action.type) { + case WebPluginAction::Rotate90Clockwise: + plugin->plugin()->rotateView(WebPlugin::RotationType90Clockwise); + break; + case WebPluginAction::Rotate90Counterclockwise: + plugin->plugin()->rotateView(WebPlugin::RotationType90Counterclockwise); + break; + default: + ASSERT_NOT_REACHED(); + } + } + } +} + void WebViewImpl::copyImageAt(const WebPoint& point) { if (!m_page) @@ -2977,6 +3006,7 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) ccSettings.partialSwapEnabled = page()->settings()->partialSwapEnabled(); m_nonCompositedContentHost = NonCompositedContentHost::create(WebViewImplContentPainter::create(this)); + m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders()); m_layerTreeHost = CCLayerTreeHost::create(this, ccSettings); if (m_layerTreeHost) { m_layerTreeHost->setHaveWheelEventHandlers(m_haveWheelEventHandlers); @@ -3089,7 +3119,7 @@ void WebViewImpl::updateLayerTreeViewport() layerAdjustX = -view->contentsSize().width() + view->visibleContentRect(false).width(); } m_nonCompositedContentHost->setViewport(visibleRect.size(), view->contentsSize(), scroll, pageScaleFactor(), layerAdjustX); - m_layerTreeHost->setViewport(visibleRect.size()); + m_layerTreeHost->setViewportSize(visibleRect.size()); m_layerTreeHost->setPageScale(pageScaleFactor()); } |