summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebViewImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/src/WebViewImpl.cpp')
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp36
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());
}