summaryrefslogtreecommitdiffstats
path: root/WebKit/win/WebCoreSupport
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-09-13 16:35:48 +0100
committerIain Merrick <husky@google.com>2010-09-16 12:10:42 +0100
commit5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306 (patch)
treeddce1aa5e3b6967a69691892e500897558ff8ab6 /WebKit/win/WebCoreSupport
parent12bec63ec71e46baba27f0bd9bd9d8067683690a (diff)
downloadexternal_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.zip
external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.gz
external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.bz2
Merge WebKit at r67178 : Initial merge by git.
Change-Id: I57e01163b6866cb029cdadf405a0394a3918bc18
Diffstat (limited to 'WebKit/win/WebCoreSupport')
-rw-r--r--WebKit/win/WebCoreSupport/WebChromeClient.cpp11
-rw-r--r--WebKit/win/WebCoreSupport/WebContextMenuClient.cpp2
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp22
-rw-r--r--WebKit/win/WebCoreSupport/WebInspectorClient.cpp21
-rw-r--r--WebKit/win/WebCoreSupport/WebInspectorClient.h3
5 files changed, 42 insertions, 17 deletions
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index d5aea25..7a025a7 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -53,6 +53,7 @@
#endif
#include <WebCore/HTMLNames.h>
#include <WebCore/Icon.h>
+#include <WebCore/LocalWindowsContext.h>
#include <WebCore/LocalizedStrings.h>
#include <WebCore/NotImplemented.h>
#include <WebCore/Page.h>
@@ -705,10 +706,9 @@ bool WebChromeClient::paintCustomScrollbar(GraphicsContext* context, const Float
webState |= WebPressedScrollbarState;
RECT webRect = enclosingIntRect(rect);
- HDC hDC = context->getWindowsContext(webRect);
- HRESULT hr = delegate->paintCustomScrollbar(m_webView, hDC, webRect, webSize, webState, webPressedPart,
+ LocalWindowsContext windowsContext(context, webRect);
+ HRESULT hr = delegate->paintCustomScrollbar(m_webView, windowsContext.hdc(), webRect, webSize, webState, webPressedPart,
vertical, value, proportion, webParts);
- context->releaseWindowsContext(hDC, webRect);
return SUCCEEDED(hr);
}
@@ -722,9 +722,8 @@ bool WebChromeClient::paintCustomScrollCorner(GraphicsContext* context, const Fl
return false;
RECT webRect = enclosingIntRect(rect);
- HDC hDC = context->getWindowsContext(webRect);
- HRESULT hr = delegate->paintCustomScrollCorner(m_webView, hDC, webRect);
- context->releaseWindowsContext(hDC, webRect);
+ LocalWindowsContext windowsContext(context, webRect);
+ HRESULT hr = delegate->paintCustomScrollCorner(m_webView, windowsContext.hdc(), webRect);
return SUCCEEDED(hr);
}
diff --git a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
index 078b725..ca0374a 100644
--- a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
@@ -131,7 +131,7 @@ void WebContextMenuClient::downloadURL(const KURL& url)
void WebContextMenuClient::searchWithGoogle(const Frame* frame)
{
- String searchString = frame->selectedText();
+ String searchString = frame->editor()->selectedText();
searchString.stripWhiteSpace();
String encoded = encodeWithURLEscapeSequences(searchString);
encoded.replace("%20", "+");
diff --git a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
index 941cfaa..9fcd4b1 100644
--- a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
@@ -17,5 +17,23 @@
Boston, MA 02110-1301, USA.
*/
-// Checking this file in empty to get the build system work out of the way.
-// Will put the code in here later.
+#include "config.h"
+
+#include "WebFrameNetworkingContext.h"
+
+using namespace WebCore;
+
+PassRefPtr<WebFrameNetworkingContext> WebFrameNetworkingContext::create(Frame* frame, const String& userAgent)
+{
+ return adoptRef(new WebFrameNetworkingContext(frame, userAgent));
+}
+
+String WebFrameNetworkingContext::userAgent() const
+{
+ return m_userAgent;
+}
+
+String WebFrameNetworkingContext::referrer() const
+{
+ return frame()->loader()->referrer();
+}
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
index 34fb827..1b79dde 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
@@ -228,7 +228,7 @@ WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView
WebInspectorFrontendClient::~WebInspectorFrontendClient()
{
- destroyInspectorView();
+ destroyInspectorView(true);
}
void WebInspectorFrontendClient::frontendLoaded()
@@ -260,7 +260,12 @@ void WebInspectorFrontendClient::bringToFront()
void WebInspectorFrontendClient::closeWindow()
{
- destroyInspectorView();
+ destroyInspectorView(true);
+}
+
+void WebInspectorFrontendClient::disconnectFromBackend()
+{
+ destroyInspectorView(false);
}
void WebInspectorFrontendClient::attachWindow()
@@ -344,8 +349,6 @@ void WebInspectorFrontendClient::closeWindowWithoutNotifications()
HWND hostWindow;
if (SUCCEEDED(m_inspectedWebView->hostWindow((OLE_HANDLE*)&hostWindow)))
SendMessage(hostWindow, WM_SIZE, 0, 0);
-
- m_inspectorClient->updateHighlight();
}
void WebInspectorFrontendClient::showWindowWithoutNotifications()
@@ -397,16 +400,20 @@ void WebInspectorFrontendClient::showWindowWithoutNotifications()
m_inspectorClient->updateHighlight();
}
-void WebInspectorFrontendClient::destroyInspectorView()
+void WebInspectorFrontendClient::destroyInspectorView(bool notifyInspectorController)
{
if (m_destroyingInspectorView)
return;
m_destroyingInspectorView = true;
- m_inspectedWebView->page()->inspectorController()->disconnectFrontend();
closeWindowWithoutNotifications();
- m_inspectorClient->frontendClosing();
+
+ if (notifyInspectorController) {
+ m_inspectedWebView->page()->inspectorController()->disconnectFrontend();
+ m_inspectorClient->updateHighlight();
+ m_inspectorClient->frontendClosing();
+ }
::DestroyWindow(m_frontendHwnd);
}
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h
index 4da3984..0c38247 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h
@@ -93,6 +93,7 @@ public:
virtual void bringToFront();
virtual void closeWindow();
+ virtual void disconnectFromBackend();
virtual void attachWindow();
virtual void detachWindow();
@@ -106,7 +107,7 @@ private:
void closeWindowWithoutNotifications();
void showWindowWithoutNotifications();
- void destroyInspectorView();
+ void destroyInspectorView(bool notifyInspectorController);
void updateWindowTitle();