Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: third_party/WebKit/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp

Issue 7538006: Pepper and WebKit API change to support a plugin knowing if a scrollbar is an overlay one. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Make scrollbars appear when chrome becomes active Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
===================================================================
--- third_party/WebKit/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp (revision 92488)
+++ third_party/WebKit/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp (working copy)
@@ -34,6 +34,7 @@
#include "Chrome.h"
#include "ChromeClientImpl.h"
#include "PluginLayerChromium.h"
+#include "ScrollbarGroup.h"
#include "WebClipboard.h"
#include "WebCursorInfo.h"
#include "WebDataSourceImpl.h"
@@ -69,7 +70,9 @@
#include "MouseEvent.h"
#include "Page.h"
#include "RenderBox.h"
+#include "ScrollAnimator.h"
#include "ScrollView.h"
+#include "ScrollbarTheme.h"
#include "UserGestureIndicator.h"
#include "WheelEvent.h"
@@ -91,6 +94,14 @@
void WebPluginContainerImpl::paint(GraphicsContext* gc, const IntRect& damageRect)
{
+ if (gc->updatingControlTints() && m_scrollbarGroup) {
+ // See comment in FrameView::updateControlTints().
+ if (m_scrollbarGroup->horizontalScrollbar())
+ m_scrollbarGroup->horizontalScrollbar()->invalidate();
+ if (m_scrollbarGroup->verticalScrollbar())
+ m_scrollbarGroup->verticalScrollbar()->invalidate();
+ }
+
if (gc->paintingDisabled())
return;
@@ -306,6 +317,9 @@
calculateGeometry(frameRect(), windowRect, clipRect, cutOutRects);
m_webPlugin->updateGeometry(windowRect, clipRect, cutOutRects, isVisible());
+
+ if (m_scrollbarGroup)
+ m_scrollbarGroup->scrollAnimator()->contentsResized();
}
void WebPluginContainerImpl::setBackingTextureId(unsigned id)
@@ -437,6 +451,26 @@
}
#endif
+
+ScrollbarGroup* WebPluginContainerImpl::scrollbarGroup()
+{
+ if (!m_scrollbarGroup)
+ m_scrollbarGroup = adoptPtr(new ScrollbarGroup(m_element->document()->frame()->page()));
+ return m_scrollbarGroup.get();
+}
+
+void WebPluginContainerImpl::willStartLiveResize()
+{
+ if (m_scrollbarGroup)
+ m_scrollbarGroup->willStartLiveResize();
+}
+
+void WebPluginContainerImpl::willEndLiveResize()
+{
+ if (m_scrollbarGroup)
+ m_scrollbarGroup->willEndLiveResize();
+}
+
// Private methods -------------------------------------------------------------
WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* element, WebPlugin* webPlugin)
@@ -476,6 +510,19 @@
containingFrame->document()->setFocusedNode(m_element);
}
+ if (m_scrollbarGroup) {
+ // This needs to be set before the other callbacks in this scope, since
+ // the scroll animator class might query the position in response.
+ m_scrollbarGroup->setLastMousePosition(IntPoint(event->x(), event->y()));
+ if (event->type() == eventNames().mousemoveEvent) {
+ m_scrollbarGroup->scrollAnimator()->mouseMovedInContentArea();
+ } else if (event->type() == eventNames().mouseoverEvent) {
+ m_scrollbarGroup->scrollAnimator()->mouseEnteredContentArea();
+ } else if (event->type() == eventNames().mouseoutEvent) {
+ m_scrollbarGroup->scrollAnimator()->mouseExitedContentArea();
+ }
+ }
+
WebCursorInfo cursorInfo;
if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
event->setDefaultHandled();

Powered by Google App Engine
This is Rietveld 408576698