summaryrefslogtreecommitdiffstats
path: root/Source/WebKit2/UIProcess/WebPageProxy.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-16 16:25:10 +0100
committerBen Murdoch <benm@google.com>2011-05-23 18:54:14 +0100
commitab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb (patch)
treedb769fadd053248f85db67434a5b275224defef7 /Source/WebKit2/UIProcess/WebPageProxy.cpp
parent52e2557aeb8477967e97fd24f20f8f407a10fa15 (diff)
downloadexternal_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.zip
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.gz
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.bz2
Merge WebKit at r76408: Initial merge by git.
Change-Id: I5b91decbd693ccbf5c1b8354b37cd68cc9a1ea53
Diffstat (limited to 'Source/WebKit2/UIProcess/WebPageProxy.cpp')
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.cpp75
1 files changed, 71 insertions, 4 deletions
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index f433fbd..0be2f11 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -227,7 +227,9 @@ void WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item)
m_backForwardList->goToItem(item);
reattachToWebProcess();
- process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
+
+ if (item)
+ process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
}
void WebPageProxy::initializeWebPage()
@@ -475,6 +477,11 @@ void WebPageProxy::displayView()
m_pageClient->displayView();
}
+void WebPageProxy::scrollView(const IntRect& scrollRect, const IntSize& scrollOffset)
+{
+ m_pageClient->scrollView(scrollRect, scrollOffset);
+}
+
void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
{
if (!isValid())
@@ -490,6 +497,7 @@ void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
bool isVisible = m_pageClient->isViewVisible();
if (isVisible != m_isVisible) {
m_isVisible = isVisible;
+ m_drawingArea->visibilityDidChange();
m_drawingArea->setPageIsVisible(isVisible);
}
}
@@ -609,6 +617,24 @@ void WebPageProxy::didPerformDragControllerAction(uint64_t resultOperation)
m_currentDragOperation = static_cast<DragOperation>(resultOperation);
}
+#if PLATFORM(MAC)
+void WebPageProxy::setDragImage(const WebCore::IntPoint& clientPosition, const IntSize& imageSize, const SharedMemory::Handle& dragImageHandle, bool isLinkDrag)
+{
+ RefPtr<ShareableBitmap> dragImage = ShareableBitmap::create(imageSize, dragImageHandle);
+ if (!dragImage)
+ return;
+
+ m_pageClient->setDragImage(clientPosition, imageSize, dragImage.release(), isLinkDrag);
+}
+#endif
+
+void WebPageProxy::dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation)
+{
+ if (!isValid())
+ return;
+ process()->send(Messages::WebPage::DragEnded(clientPosition, globalPosition, operation), m_pageID);
+}
+
void WebPageProxy::handleMouseEvent(const WebMouseEvent& event)
{
if (!isValid())
@@ -960,6 +986,14 @@ void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, PassRefPtr<D
process()->send(Messages::WebPage::GetMainResourceDataOfFrame(frame->frameID(), callbackID), m_pageID);
}
+void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, WebURL* resourceURL, PassRefPtr<DataCallback> prpCallback)
+{
+ RefPtr<DataCallback> callback = prpCallback;
+ uint64_t callbackID = callback->callbackID();
+ m_dataCallbacks.set(callbackID, callback.get());
+ process()->send(Messages::WebPage::GetResourceDataFromFrame(frame->frameID(), resourceURL->string(), callbackID), m_pageID);
+}
+
void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
{
RefPtr<DataCallback> callback = prpCallback;
@@ -1067,6 +1101,11 @@ void WebPageProxy::didCreateSubframe(uint64_t frameID, uint64_t parentFrameID)
parentFrame->appendChild(subFrame.get());
}
+static bool isDisconnectedFrame(WebFrameProxy* frame)
+{
+ return !frame->page() || !frame->page()->mainFrame() || !frame->isDescendantOf(frame->page()->mainFrame());
+}
+
void WebPageProxy::didSaveFrameToPageCache(uint64_t frameID)
{
MESSAGE_CHECK(m_mainFrame);
@@ -1074,7 +1113,7 @@ void WebPageProxy::didSaveFrameToPageCache(uint64_t frameID)
WebFrameProxy* subframe = process()->webFrame(frameID);
MESSAGE_CHECK(subframe);
- if (!subframe->parentFrame())
+ if (isDisconnectedFrame(subframe))
return;
MESSAGE_CHECK(subframe->isDescendantOf(m_mainFrame.get()));
@@ -1633,6 +1672,14 @@ void WebPageProxy::runOpenPanel(uint64_t frameID, const WebOpenPanelParameters::
didCancelForOpenPanel();
}
+void WebPageProxy::printFrame(uint64_t frameID)
+{
+ WebFrameProxy* frame = process()->webFrame(frameID);
+ MESSAGE_CHECK(frame);
+
+ m_uiClient.printFrame(this, frame);
+}
+
#if PLATFORM(QT)
void WebPageProxy::didChangeContentsSize(const WebCore::IntSize& size)
{
@@ -2231,7 +2278,6 @@ WebPageCreationParameters WebPageProxy::creationParameters() const
parameters.isFocused = m_pageClient->isViewFocused();
parameters.isVisible = m_pageClient->isViewVisible();
parameters.isInWindow = m_pageClient->isViewInWindow();
-
parameters.drawingAreaInfo = m_drawingArea->info();
parameters.store = m_pageGroup->preferences()->store();
parameters.pageGroupData = m_pageGroup->data();
@@ -2242,6 +2288,7 @@ WebPageCreationParameters WebPageProxy::creationParameters() const
parameters.userAgent = userAgent();
parameters.sessionState = SessionState(m_backForwardList->entries(), m_backForwardList->currentIndex());
parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
+ parameters.canRunModal = m_uiClient.canRunModal();
#if PLATFORM(MAC)
parameters.isSmartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled;
@@ -2315,6 +2362,26 @@ void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID,
request->deny();
}
+float WebPageProxy::headerHeight(WebFrameProxy* frame)
+{
+ return m_uiClient.headerHeight(this, frame);
+}
+
+float WebPageProxy::footerHeight(WebFrameProxy* frame)
+{
+ return m_uiClient.footerHeight(this, frame);
+}
+
+void WebPageProxy::drawHeader(WebFrameProxy* frame, const WebCore::FloatRect& rect)
+{
+ m_uiClient.drawHeader(this, frame, rect);
+}
+
+void WebPageProxy::drawFooter(WebFrameProxy* frame, const WebCore::FloatRect& rect)
+{
+ m_uiClient.drawFooter(this, frame, rect);
+}
+
void WebPageProxy::didFinishLoadingDataForCustomRepresentation(const CoreIPC::DataReference& dataReference)
{
m_pageClient->didFinishLoadingDataForCustomRepresentation(dataReference);