Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WebPageProxy cleanup
https://bugs.webkit.org/show_bug.cgi?id=56267

Reviewed by Darin Adler.

* UIProcess/WebPageProxy.cpp: Moved all Mac-only function implementations from
here to WebPageProxyMac.mm.
* UIProcess/WebPageProxy.h: Cleaned up #includes.
* UIProcess/mac/WebPageProxyMac.mm: Moved all Mac-only function implementations
here.
(WebKit::WebPageProxy::updateWindowIsVisible):
(WebKit::WebPageProxy::windowAndViewFramesChanged):
(WebKit::WebPageProxy::getMarkedRange):
(WebKit::WebPageProxy::characterIndexForPoint):
(WebKit::WebPageProxy::firstRectForCharacterRange):
(WebKit::WebPageProxy::writeSelectionToPasteboard):
(WebKit::WebPageProxy::setDragImage):
(WebKit::WebPageProxy::performDictionaryLookupAtLocation):
(WebKit::WebPageProxy::interpretKeyEvent):
(WebKit::WebPageProxy::sendComplexTextInputToPlugin):
(WebKit::WebPageProxy::uppercaseWord):
(WebKit::WebPageProxy::lowercaseWord):
(WebKit::WebPageProxy::capitalizeWord):
(WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
(WebKit::WebPageProxy::didPerformDictionaryLookup):
(WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
(WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
(WebKit::WebPageProxy::setComplexTextInputEnabled):



Canonical link: https://commits.webkit.org/70853@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80968 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Dan Bernstein committed Mar 13, 2011
1 parent 320a5ff commit 04a372e
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 152 deletions.
31 changes: 31 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,34 @@
2011-03-13 Dan Bernstein <mitz@apple.com>

Reviewed by Darin Adler.

WebPageProxy cleanup
https://bugs.webkit.org/show_bug.cgi?id=56267

* UIProcess/WebPageProxy.cpp: Moved all Mac-only function implementations from
here to WebPageProxyMac.mm.
* UIProcess/WebPageProxy.h: Cleaned up #includes.
* UIProcess/mac/WebPageProxyMac.mm: Moved all Mac-only function implementations
here.
(WebKit::WebPageProxy::updateWindowIsVisible):
(WebKit::WebPageProxy::windowAndViewFramesChanged):
(WebKit::WebPageProxy::getMarkedRange):
(WebKit::WebPageProxy::characterIndexForPoint):
(WebKit::WebPageProxy::firstRectForCharacterRange):
(WebKit::WebPageProxy::writeSelectionToPasteboard):
(WebKit::WebPageProxy::setDragImage):
(WebKit::WebPageProxy::performDictionaryLookupAtLocation):
(WebKit::WebPageProxy::interpretKeyEvent):
(WebKit::WebPageProxy::sendComplexTextInputToPlugin):
(WebKit::WebPageProxy::uppercaseWord):
(WebKit::WebPageProxy::lowercaseWord):
(WebKit::WebPageProxy::capitalizeWord):
(WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
(WebKit::WebPageProxy::didPerformDictionaryLookup):
(WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
(WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
(WebKit::WebPageProxy::setComplexTextInputEnabled):

2011-03-13 Dan Bernstein <mitz@apple.com>

Reviewed by Darin Adler.
Expand Down
142 changes: 2 additions & 140 deletions Source/WebKit2/UIProcess/WebPageProxy.cpp
Expand Up @@ -53,6 +53,7 @@
#include "WebFormSubmissionListenerProxy.h"
#include "WebFramePolicyListenerProxy.h"
#include "WebFullScreenManagerProxy.h"
#include "WebInspectorProxy.h"
#include "WebOpenPanelResultListenerProxy.h"
#include "WebPageCreationParameters.h"
#include "WebPageGroup.h"
Expand All @@ -72,10 +73,6 @@
#include <WebCore/WindowFeatures.h>
#include <stdio.h>

#if PLATFORM(MAC)
#include "DictionaryPopupInfo.h"
#endif

#if PLATFORM(WIN)
#include "WebDragSource.h"
#include <WebCore/BitmapInfo.h>
Expand Down Expand Up @@ -641,49 +638,7 @@ void WebPageProxy::executeEditCommand(const String& commandName)
process()->send(Messages::WebPage::ExecuteEditCommand(commandName), m_pageID);
}

#if PLATFORM(MAC)
void WebPageProxy::updateWindowIsVisible(bool windowIsVisible)
{
if (!isValid())
return;
process()->send(Messages::WebPage::SetWindowIsVisible(windowIsVisible), m_pageID);
}

void WebPageProxy::windowAndViewFramesChanged(const IntRect& windowFrameInScreenCoordinates, const IntRect& viewFrameInWindowCoordinates, const IntPoint& accessibilityViewCoordinates)
{
if (!isValid())
return;

process()->send(Messages::WebPage::WindowAndViewFramesChanged(windowFrameInScreenCoordinates, viewFrameInWindowCoordinates, accessibilityViewCoordinates), m_pageID);
}

void WebPageProxy::getMarkedRange(uint64_t& location, uint64_t& length)
{
process()->sendSync(Messages::WebPage::GetMarkedRange(), Messages::WebPage::GetMarkedRange::Reply(location, length), m_pageID);
}

uint64_t WebPageProxy::characterIndexForPoint(const IntPoint point)
{
uint64_t result;
process()->sendSync(Messages::WebPage::CharacterIndexForPoint(point), Messages::WebPage::CharacterIndexForPoint::Reply(result), m_pageID);
return result;
}

WebCore::IntRect WebPageProxy::firstRectForCharacterRange(uint64_t location, uint64_t length)
{
IntRect resultRect;
process()->sendSync(Messages::WebPage::FirstRectForCharacterRange(location, length), Messages::WebPage::FirstRectForCharacterRange::Reply(resultRect), m_pageID);
return resultRect;
}

bool WebPageProxy::writeSelectionToPasteboard(const String& pasteboardName, const Vector<String>& pasteboardTypes)
{
bool result;
const double MessageTimeout = 20;
process()->sendSync(Messages::WebPage::WriteSelectionToPasteboard(pasteboardName, pasteboardTypes), Messages::WebPage::WriteSelectionToPasteboard::Reply(result), m_pageID, MessageTimeout);
return result;
}
#elif PLATFORM(WIN)
#if PLATFORM(WIN)
WebCore::IntRect WebPageProxy::firstRectForCharacterInSelectedRange(int characterPosition)
{
IntRect resultRect;
Expand Down Expand Up @@ -727,17 +682,6 @@ 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

#if PLATFORM(WIN)

void WebPageProxy::startDragDrop(const IntPoint& imageOrigin, const IntPoint& dragPoint, uint64_t okEffect,
Expand Down Expand Up @@ -1213,16 +1157,6 @@ void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
process()->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID);
}

#if PLATFORM(MAC)
void WebPageProxy::performDictionaryLookupAtLocation(const WebCore::FloatPoint& point)
{
if (!isValid())
return;

process()->send(Messages::WebPage::PerformDictionaryLookupAtLocation(point), m_pageID);
}
#endif

void WebPageProxy::preferencesDidChange()
{
if (!isValid())
Expand Down Expand Up @@ -1296,13 +1230,6 @@ void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIP
didReceiveSyncWebPageProxyMessage(connection, messageID, arguments, reply);
}

#if PLATFORM(MAC)
void WebPageProxy::interpretKeyEvent(uint32_t type, Vector<KeypressCommand>& commandsList, uint32_t selectionStart, uint32_t selectionEnd, Vector<CompositionUnderline>& underlines)
{
m_pageClient->interceptKeyEvent(m_keyEventQueue.first(), commandsList, selectionStart, selectionEnd, underlines);
}
#endif

void WebPageProxy::didCreateMainFrame(uint64_t frameID)
{
MESSAGE_CHECK(!m_mainFrame);
Expand Down Expand Up @@ -2052,17 +1979,6 @@ void WebPageProxy::selectionStateChanged(const SelectionState& selectionState)
m_selectionState = selectionState;
}

#if PLATFORM(MAC)
// Complex text input support for plug-ins.
void WebPageProxy::sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput)
{
if (!isValid())
return;

process()->send(Messages::WebPage::SendComplexTextInputToPlugin(pluginComplexTextInputIdentifier, textInput), m_pageID);
}
#endif

#if PLATFORM(WIN)
void WebPageProxy::didChangeCompositionSelection(bool hasComposition)
{
Expand Down Expand Up @@ -2297,33 +2213,6 @@ void WebPageProxy::unmarkAllBadGrammar()
process()->send(Messages::WebPage::UnmarkAllBadGrammar(), m_pageID);
}

#if PLATFORM(MAC)
void WebPageProxy::uppercaseWord()
{
process()->send(Messages::WebPage::UppercaseWord(), m_pageID);
}

void WebPageProxy::lowercaseWord()
{
process()->send(Messages::WebPage::LowercaseWord(), m_pageID);
}

void WebPageProxy::capitalizeWord()
{
process()->send(Messages::WebPage::CapitalizeWord(), m_pageID);
}

void WebPageProxy::setSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled)
{
if (m_isSmartInsertDeleteEnabled == isSmartInsertDeleteEnabled)
return;

TextChecker::setSmartInsertDeleteEnabled(isSmartInsertDeleteEnabled);
m_isSmartInsertDeleteEnabled = isSmartInsertDeleteEnabled;
process()->send(Messages::WebPage::SetSmartInsertDeleteEnabled(isSmartInsertDeleteEnabled), m_pageID);
}
#endif

void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo)
{
m_pageClient->registerEditCommand(commandProxy, undoOrRedo);
Expand Down Expand Up @@ -2556,26 +2445,6 @@ void WebPageProxy::validateCommandCallback(const String& commandName, bool isEna
callback->performCallbackWithReturnValue(commandName.impl(), isEnabled, state);
}

#if PLATFORM(MAC)
void WebPageProxy::didPerformDictionaryLookup(const String& text, const DictionaryPopupInfo& dictionaryPopupInfo)
{
m_pageClient->didPerformDictionaryLookup(text, m_viewScaleFactor, dictionaryPopupInfo);
}

void WebPageProxy::registerWebProcessAccessibilityToken(const CoreIPC::DataReference& data)
{
m_pageClient->accessibilityWebProcessTokenReceived(data);
}

void WebPageProxy::registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elementToken, const CoreIPC::DataReference& windowToken)
{
if (!isValid())
return;

process()->send(Messages::WebPage::RegisterUIProcessAccessibilityTokens(elementToken, windowToken), m_pageID);
}
#endif

void WebPageProxy::focusedFrameChanged(uint64_t frameID)
{
if (!frameID) {
Expand Down Expand Up @@ -2815,13 +2684,6 @@ void WebPageProxy::didFinishLoadingDataForCustomRepresentation(const String& sug
m_pageClient->didFinishLoadingDataForCustomRepresentation(suggestedFilename, dataReference);
}

#if PLATFORM(MAC)
void WebPageProxy::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled)
{
m_pageClient->setComplexTextInputEnabled(pluginComplexTextInputIdentifier, complexTextInputEnabled);
}
#endif

void WebPageProxy::backForwardRemovedItem(uint64_t itemID)
{
process()->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageID);
Expand Down
12 changes: 1 addition & 11 deletions Source/WebKit2/UIProcess/WebPageProxy.h
Expand Up @@ -27,6 +27,7 @@
#define WebPageProxy_h

#include "APIObject.h"
#include "Connection.h"
#include "ContextMenuState.h"
#include "DragControllerAction.h"
#include "DrawingAreaProxy.h"
Expand All @@ -37,24 +38,16 @@
#include "WKBase.h"
#include "WKPagePrivate.h"
#include "WebContextMenuItemData.h"
#include "WebEvent.h"
#include "WebFindClient.h"
#include "WebFindOptions.h"
#include "WebFormClient.h"
#include "WebFrameProxy.h"
#include "WebHistoryClient.h"
#include "WebInspectorProxy.h"
#include "WebLoaderClient.h"
#include "WebPageContextMenuClient.h"
#include "WebPolicyClient.h"
#include "WebPopupMenuProxy.h"
#include "WebResourceLoadClient.h"
#include "WebUIClient.h"
#include <WebCore/DragActions.h>
#include <WebCore/EditAction.h>
#include <WebCore/Editor.h>
#include <WebCore/FrameLoaderTypes.h>
#include <WebCore/KeyboardEvent.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
Expand Down Expand Up @@ -83,7 +76,6 @@ namespace WebCore {

namespace WebKit {

class DrawingAreaProxy;
class NativeWebKeyboardEvent;
class PageClient;
class PlatformCertificateInfo;
Expand All @@ -98,11 +90,9 @@ class WebKeyboardEvent;
class WebMouseEvent;
class WebOpenPanelResultListenerProxy;
class WebPageGroup;
class WebPopupMenuProxy;
class WebProcessProxy;
class WebURLRequest;
class WebWheelEvent;
struct ContextMenuState;
struct DictionaryPopupInfo;
struct PlatformPopupMenuData;
struct PrintInfo;
Expand Down

0 comments on commit 04a372e

Please sign in to comment.