summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 04:03:41 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 04:03:41 +0000
commit85c4eafd31af67b19e55fbb2ed8bc17b1f068ddd (patch)
tree621753f01944b97fa288e15cda185ac3dffb921e
parent3d392a6fd21a84a4eae5cc340242219f5062b46d (diff)
downloadchromium_src-85c4eafd31af67b19e55fbb2ed8bc17b1f068ddd.zip
chromium_src-85c4eafd31af67b19e55fbb2ed8bc17b1f068ddd.tar.gz
chromium_src-85c4eafd31af67b19e55fbb2ed8bc17b1f068ddd.tar.bz2
Modify our webkit code to make sure it does not call into
glue directly. Everything now goes through webkitclient. This is the first step to be able to split webkit in its own dll. Review URL: http://codereview.chromium.org/196051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25967 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/api/public/WebKitClient.h5
-rw-r--r--webkit/api/src/ChromiumBridge.cpp63
-rw-r--r--webkit/api/src/TemporaryGlue.h26
-rw-r--r--webkit/api/src/WebMediaPlayerClientImpl.cpp3
-rw-r--r--webkit/api/src/WebPluginContainerImpl.cpp5
-rw-r--r--webkit/glue/chromium_bridge_impl.cc175
-rw-r--r--webkit/glue/temporary_glue.cc47
-rw-r--r--webkit/glue/webkitclient_impl.cc155
-rw-r--r--webkit/glue/webkitclient_impl.h18
-rw-r--r--webkit/glue/webworkerclient_impl.cc6
-rw-r--r--webkit/glue/webworkerclient_impl.h4
-rw-r--r--webkit/webkit.gyp2
12 files changed, 273 insertions, 236 deletions
diff --git a/webkit/api/public/WebKitClient.h b/webkit/api/public/WebKitClient.h
index 4ff33b3..722ba97 100644
--- a/webkit/api/public/WebKitClient.h
+++ b/webkit/api/public/WebKitClient.h
@@ -35,6 +35,7 @@
#include "WebCommon.h"
#include "WebLocalizedString.h"
+#include "webkit/api/src/TemporaryGlue.h"
#if defined(OS_WIN)
#include <windows.h>
@@ -57,7 +58,9 @@ namespace WebKit {
struct WebPluginInfo;
template <typename T> class WebVector;
- class WebKitClient {
+ // FIXME: Once our webkit api is complete, we should not need to inherit
+ // from TemporaryGlue here.
+ class WebKitClient : public TemporaryGlue {
public:
// Must return non-null.
virtual WebClipboard* clipboard() = 0;
diff --git a/webkit/api/src/ChromiumBridge.cpp b/webkit/api/src/ChromiumBridge.cpp
index 9b07db3..4a3e975 100644
--- a/webkit/api/src/ChromiumBridge.cpp
+++ b/webkit/api/src/ChromiumBridge.cpp
@@ -43,6 +43,8 @@
#include "WebPluginListBuilderImpl.h"
#include "WebString.h"
#include "WebURL.h"
+#include "Worker.h"
+#include "WorkerContextProxy.h"
#if PLATFORM(WIN_OS)
#include "WebRect.h"
@@ -505,4 +507,63 @@ bool ChromiumBridge::isLinkVisited(WebCore::LinkHash visitedLinkHash)
return webKitClient()->isLinkVisited(visitedLinkHash);
}
-} // namespace WebCore
+// These are temporary methoeds that the WebKit layer can use to call to the
+// Glue layer. Once the Glue layer moves entirely into the WebKit layer, these
+// methods will be deleted.
+
+String ChromiumBridge::uiResourceProtocol()
+{
+ return webKitClient()->uiResourceProtocol();
+}
+
+void ChromiumBridge::notifyJSOutOfMemory(WebCore::Frame* frame)
+{
+ return webKitClient()->notifyJSOutOfMemory(frame);
+}
+
+int ChromiumBridge::screenDepth(Widget* widget)
+{
+ return webKitClient()->screenDepth(widget);
+}
+
+int ChromiumBridge::screenDepthPerComponent(Widget* widget)
+{
+ return webKitClient()->screenDepthPerComponent(widget);
+}
+
+bool ChromiumBridge::screenIsMonochrome(Widget* widget)
+{
+ return webKitClient()->screenIsMonochrome(widget);
+}
+
+IntRect ChromiumBridge::screenRect(Widget* widget)
+{
+ return webKitClient()->screenRect(widget);
+}
+
+IntRect ChromiumBridge::screenAvailableRect(Widget* widget)
+{
+ return webKitClient()->screenAvailableRect(widget);
+}
+
+bool ChromiumBridge::popupsAllowed(NPP npp)
+{
+ return webKitClient()->popupsAllowed(npp);
+}
+
+void ChromiumBridge::widgetSetCursor(Widget* widget, const Cursor& cursor)
+{
+ return webKitClient()->widgetSetCursor(widget, cursor);
+}
+
+void ChromiumBridge::widgetSetFocus(Widget* widget)
+{
+ return webKitClient()->widgetSetFocus(widget);
+}
+
+WorkerContextProxy* WorkerContextProxy::create(Worker* worker)
+{
+ return webKitClient()->createWorkerContextProxy(worker);
+}
+
+} // namespace WebCore \ No newline at end of file
diff --git a/webkit/api/src/TemporaryGlue.h b/webkit/api/src/TemporaryGlue.h
index dc37a94..b52f384 100644
--- a/webkit/api/src/TemporaryGlue.h
+++ b/webkit/api/src/TemporaryGlue.h
@@ -35,8 +35,18 @@
// use to call to the Glue layer. Once the Glue layer moves entirely into the
// WebKit layer, this file will be deleted.
+struct _NPP;
+typedef struct _NPP NPP_t;
+typedef NPP_t* NPP;
+
namespace WebCore {
+ class Cursor;
class Frame;
+ class IntRect;
+ class String;
+ class Widget;
+ class Worker;
+ class WorkerContextProxy;
} // namespace WebCore
namespace WebKit {
@@ -46,9 +56,19 @@ namespace WebKit {
class TemporaryGlue {
public:
- static WebMediaPlayer* createWebMediaPlayer(WebMediaPlayerClient*, WebCore::Frame*);
-
- static void setCursorForPlugin(const WebCursorInfo&, WebCore::Frame*);
+ virtual WebMediaPlayer* createWebMediaPlayer(WebMediaPlayerClient*, WebCore::Frame*) = 0;
+ virtual void setCursorForPlugin(const WebCursorInfo&, WebCore::Frame*) = 0;
+ virtual WebCore::String uiResourceProtocol() = 0;
+ virtual void notifyJSOutOfMemory(WebCore::Frame*) = 0;
+ virtual int screenDepth(WebCore::Widget*) = 0;
+ virtual int screenDepthPerComponent(WebCore::Widget*) = 0;
+ virtual bool screenIsMonochrome(WebCore::Widget*) = 0;
+ virtual WebCore::IntRect screenRect(WebCore::Widget*) = 0;
+ virtual WebCore::IntRect screenAvailableRect(WebCore::Widget*) = 0;
+ virtual bool popupsAllowed(NPP) = 0;
+ virtual void widgetSetCursor(WebCore::Widget*, const WebCore::Cursor&) = 0;
+ virtual void widgetSetFocus(WebCore::Widget*) = 0;
+ virtual WebCore::WorkerContextProxy* createWorkerContextProxy(WebCore::Worker* worker) = 0;
};
} // namespace WebKit
diff --git a/webkit/api/src/WebMediaPlayerClientImpl.cpp b/webkit/api/src/WebMediaPlayerClientImpl.cpp
index b07ff6f..3cb82c6 100644
--- a/webkit/api/src/WebMediaPlayerClientImpl.cpp
+++ b/webkit/api/src/WebMediaPlayerClientImpl.cpp
@@ -7,7 +7,6 @@
#if ENABLE(VIDEO)
-#include "TemporaryGlue.h"
#include "TimeRanges.h"
#include "WebCanvas.h"
#include "WebCString.h"
@@ -117,7 +116,7 @@ void WebMediaPlayerClientImpl::load(const String& url)
{
Frame* frame = static_cast<HTMLMediaElement*>(
m_mediaPlayer->mediaPlayerClient())->document()->frame();
- m_webMediaPlayer.set(TemporaryGlue::createWebMediaPlayer(this, frame));
+ m_webMediaPlayer.set(webKitClient()->createWebMediaPlayer(this, frame));
if (m_webMediaPlayer.get())
m_webMediaPlayer->load(KURL(ParsedURLString, url));
}
diff --git a/webkit/api/src/WebPluginContainerImpl.cpp b/webkit/api/src/WebPluginContainerImpl.cpp
index b537939..0f839a9 100644
--- a/webkit/api/src/WebPluginContainerImpl.cpp
+++ b/webkit/api/src/WebPluginContainerImpl.cpp
@@ -31,11 +31,12 @@
#include "config.h"
#include "WebPluginContainerImpl.h"
-#include "TemporaryGlue.h"
#include "WebCursorInfo.h"
#include "WebDataSourceImpl.h"
#include "WebInputEvent.h"
#include "WebInputEventConversion.h"
+#include "WebKit.h"
+#include "WebKitClient.h"
#include "WebPlugin.h"
#include "WebRect.h"
#include "WebURLError.h"
@@ -359,7 +360,7 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
// A windowless plugin can change the cursor in response to a mouse move
// event. We need to reflect the changed cursor in the frame view as the
// mouse is moved in the boundaries of the windowless plugin.
- TemporaryGlue::setCursorForPlugin(cursorInfo, parentView->frame());
+ webKitClient()->setCursorForPlugin(cursorInfo, parentView->frame());
}
void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event)
diff --git a/webkit/glue/chromium_bridge_impl.cc b/webkit/glue/chromium_bridge_impl.cc
deleted file mode 100644
index 94b7dd7..0000000
--- a/webkit/glue/chromium_bridge_impl.cc
+++ /dev/null
@@ -1,175 +0,0 @@
-// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this
-// source code is governed by a BSD-style license that can be found in the
-// LICENSE file.
-
-#include "config.h"
-#include "ChromiumBridge.h"
-
-#include "BitmapImage.h"
-#include "Cursor.h"
-#include "Frame.h"
-#include "FrameView.h"
-#include "HostWindow.h"
-#include "KURL.h"
-#include "NativeImageSkia.h"
-#include "Page.h"
-#include "PasteboardPrivate.h"
-#include "PlatformContextSkia.h"
-#include "PlatformString.h"
-#include "PlatformWidget.h"
-#include "PluginData.h"
-#include "PluginInfoStore.h"
-#include "ScrollbarTheme.h"
-#include "ScrollView.h"
-#include "SystemTime.h"
-#include "Widget.h"
-#include <wtf/CurrentTime.h>
-
-#undef LOG
-#include "base/file_util.h"
-#include "base/string_util.h"
-#include "build/build_config.h"
-#include "googleurl/src/url_util.h"
-#include "skia/ext/skia_utils_win.h"
-#include "webkit/api/public/WebCursorInfo.h"
-#include "webkit/api/public/WebFrameClient.h"
-#include "webkit/api/public/WebScreenInfo.h"
-#include "webkit/glue/chrome_client_impl.h"
-#include "webkit/glue/glue_util.h"
-#include "webkit/glue/plugins/plugin_instance.h"
-#include "webkit/glue/webkit_glue.h"
-#include "webkit/glue/webview_impl.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#include <vssym32.h>
-#include "base/gfx/native_theme.h"
-#endif
-
-using WebKit::WebCursorInfo;
-using WebKit::WebWidgetClient;
-
-namespace {
-
-gfx::NativeViewId ToNativeId(WebCore::Widget* widget) {
- if (!widget)
- return 0;
- return widget->root()->hostWindow()->platformWindow();
-}
-
-ChromeClientImpl* ToChromeClient(WebCore::Widget* widget) {
- WebCore::FrameView* view;
- if (widget->isFrameView()) {
- view = static_cast<WebCore::FrameView*>(widget);
- } else if (widget->parent() && widget->parent()->isFrameView()) {
- view = static_cast<WebCore::FrameView*>(widget->parent());
- } else {
- return NULL;
- }
-
- WebCore::Page* page = view->frame() ? view->frame()->page() : NULL;
- if (!page)
- return NULL;
-
- return static_cast<ChromeClientImpl*>(page->chrome()->client());
-}
-
-WebWidgetClient* ToWebWidgetClient(WebCore::Widget* widget) {
- ChromeClientImpl* chrome_client = ToChromeClient(widget);
- if (!chrome_client || !chrome_client->webview())
- return NULL;
- return chrome_client->webview()->delegate();
-}
-
-WebCore::IntRect ToIntRect(const WebKit::WebRect& input) {
- return WebCore::IntRect(input.x, input.y, input.width, input.height);
-}
-
-} // namespace
-
-namespace WebCore {
-
-// JavaScript -----------------------------------------------------------------
-
-void ChromiumBridge::notifyJSOutOfMemory(Frame* frame) {
- if (!frame)
- return;
-
- WebFrameImpl* webframe = WebFrameImpl::FromFrame(frame);
- if (!webframe->client())
- return;
- webframe->client()->didExhaustMemoryAvailableForScript(webframe);
-}
-
-// Plugin ---------------------------------------------------------------------
-
-bool ChromiumBridge::popupsAllowed(NPP npp) {
- bool popups_allowed = false;
- if (npp) {
- NPAPI::PluginInstance* plugin_instance =
- reinterpret_cast<NPAPI::PluginInstance*>(npp->ndata);
- if (plugin_instance)
- popups_allowed = plugin_instance->popups_allowed();
- }
- return popups_allowed;
-}
-
-// Protocol -------------------------------------------------------------------
-
-String ChromiumBridge::uiResourceProtocol() {
- return webkit_glue::StdStringToString(webkit_glue::GetUIResourceProtocol());
-}
-
-
-// Screen ---------------------------------------------------------------------
-
-int ChromiumBridge::screenDepth(Widget* widget) {
- WebWidgetClient* client = ToWebWidgetClient(widget);
- if (!client)
- return 0;
- return client->screenInfo().depth;
-}
-
-int ChromiumBridge::screenDepthPerComponent(Widget* widget) {
- WebWidgetClient* client = ToWebWidgetClient(widget);
- if (!client)
- return 0;
- return client->screenInfo().depthPerComponent;
-}
-
-bool ChromiumBridge::screenIsMonochrome(Widget* widget) {
- WebWidgetClient* client = ToWebWidgetClient(widget);
- if (!client)
- return false;
- return client->screenInfo().isMonochrome;
-}
-
-IntRect ChromiumBridge::screenRect(Widget* widget) {
- WebWidgetClient* client = ToWebWidgetClient(widget);
- if (!client)
- return IntRect();
- return ToIntRect(client->screenInfo().rect);
-}
-
-IntRect ChromiumBridge::screenAvailableRect(Widget* widget) {
- WebWidgetClient* client = ToWebWidgetClient(widget);
- if (!client)
- return IntRect();
- return ToIntRect(client->screenInfo().availableRect);
-}
-
-// Widget ---------------------------------------------------------------------
-
-void ChromiumBridge::widgetSetCursor(Widget* widget, const Cursor& cursor) {
- ChromeClientImpl* chrome_client = ToChromeClient(widget);
- if (chrome_client)
- chrome_client->SetCursor(webkit_glue::CursorToWebCursorInfo(cursor));
-}
-
-void ChromiumBridge::widgetSetFocus(Widget* widget) {
- ChromeClientImpl* chrome_client = ToChromeClient(widget);
- if (chrome_client)
- chrome_client->focus();
-}
-
-} // namespace WebCore
diff --git a/webkit/glue/temporary_glue.cc b/webkit/glue/temporary_glue.cc
deleted file mode 100644
index 774efd5..0000000
--- a/webkit/glue/temporary_glue.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "webkit/api/src/TemporaryGlue.h"
-
-#include "Page.h"
-#include <wtf/Assertions.h>
-#undef LOG
-
-#include "webkit/api/public/WebFrameClient.h"
-#include "webkit/glue/chrome_client_impl.h"
-#include "webkit/glue/webframe_impl.h"
-
-using WebCore::Frame;
-using WebCore::Page;
-
-namespace WebKit {
-
-// static
-WebMediaPlayer* TemporaryGlue::createWebMediaPlayer(
- WebMediaPlayerClient* client, Frame* frame) {
- WebFrameImpl* webframe = WebFrameImpl::FromFrame(frame);
- if (!webframe->client())
- return NULL;
-
- return webframe->client()->createMediaPlayer(webframe, client);
-}
-
-// static
-void TemporaryGlue::setCursorForPlugin(
- const WebCursorInfo& cursor_info, Frame* frame) {
- Page* page = frame->page();
- if (!page)
- return;
-
- ChromeClientImpl* chrome_client =
- static_cast<ChromeClientImpl*>(page->chrome()->client());
-
- // A windowless plugin can change the cursor in response to the WM_MOUSEMOVE
- // event. We need to reflect the changed cursor in the frame view as the
- // mouse is moved in the boundaries of the windowless plugin.
- chrome_client->SetCursorForPlugin(cursor_info);
-}
-
-} // namespace WebKit
diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc
index ddd213d..4dce4df 100644
--- a/webkit/glue/webkitclient_impl.cc
+++ b/webkit/glue/webkitclient_impl.cc
@@ -2,6 +2,13 @@
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
+#include "config.h"
+
+#include "FrameView.h"
+#include "ScrollView.h"
+#include <wtf/Assertions.h>
+#undef LOG
+
#include "webkit/glue/webkitclient_impl.h"
#include "base/file_path.h"
@@ -13,21 +20,59 @@
#include "base/trace_event.h"
#include "grit/webkit_resources.h"
#include "grit/webkit_strings.h"
+#include "webkit/api/public/WebCursorInfo.h"
#include "webkit/api/public/WebData.h"
+#include "webkit/api/public/WebFrameClient.h"
#include "webkit/api/public/WebPluginListBuilder.h"
+#include "webkit/api/public/WebScreenInfo.h"
#include "webkit/api/public/WebString.h"
+#include "webkit/glue/chrome_client_impl.h"
+#include "webkit/glue/glue_util.h"
+#include "webkit/glue/plugins/plugin_instance.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webplugininfo.h"
#include "webkit/glue/weburlloader_impl.h"
+#include "webkit/glue/webview_impl.h"
+#include "webkit/glue/webworkerclient_impl.h"
using WebKit::WebApplicationCacheHost;
using WebKit::WebApplicationCacheHostClient;
+using WebKit::WebCursorInfo;
using WebKit::WebData;
using WebKit::WebLocalizedString;
using WebKit::WebPluginListBuilder;
using WebKit::WebString;
using WebKit::WebThemeEngine;
using WebKit::WebURLLoader;
+using WebKit::WebWidgetClient;
+
+namespace {
+
+ChromeClientImpl* ToChromeClient(WebCore::Widget* widget) {
+ WebCore::FrameView* view;
+ if (widget->isFrameView()) {
+ view = static_cast<WebCore::FrameView*>(widget);
+ } else if (widget->parent() && widget->parent()->isFrameView()) {
+ view = static_cast<WebCore::FrameView*>(widget->parent());
+ } else {
+ return NULL;
+ }
+
+ WebCore::Page* page = view->frame() ? view->frame()->page() : NULL;
+ if (!page)
+ return NULL;
+
+ return static_cast<ChromeClientImpl*>(page->chrome()->client());
+}
+
+WebWidgetClient* ToWebWidgetClient(WebCore::Widget* widget) {
+ ChromeClientImpl* chrome_client = ToChromeClient(widget);
+ if (!chrome_client || !chrome_client->webview())
+ return NULL;
+ return chrome_client->webview()->delegate();
+}
+
+}
namespace webkit_glue {
@@ -309,4 +354,112 @@ bool WebKitClientImpl::makeAllDirectories(
return file_util::CreateDirectory(FilePath(file_path));
}
-} // namespace webkit_glue
+//--------------------------------------------------------------------------
+
+// These are temporary methods that the WebKit layer can use to call to the
+// Glue layer. Once the Glue layer moves entirely into the WebKit layer, these
+// methods will be deleted.
+
+WebKit::WebMediaPlayer* WebKitClientImpl::createWebMediaPlayer(
+ WebKit::WebMediaPlayerClient* client, WebCore::Frame* frame) {
+ WebFrameImpl* webframe = WebFrameImpl::FromFrame(frame);
+ if (!webframe->client())
+ return NULL;
+
+ return webframe->client()->createMediaPlayer(webframe, client);
+}
+
+void WebKitClientImpl::setCursorForPlugin(
+ const WebKit::WebCursorInfo& cursor_info, WebCore::Frame* frame) {
+ WebCore::Page* page = frame->page();
+ if (!page)
+ return;
+
+ ChromeClientImpl* chrome_client =
+ static_cast<ChromeClientImpl*>(page->chrome()->client());
+
+ // A windowless plugin can change the cursor in response to the WM_MOUSEMOVE
+ // event. We need to reflect the changed cursor in the frame view as the
+ // mouse is moved in the boundaries of the windowless plugin.
+ chrome_client->SetCursorForPlugin(cursor_info);
+}
+
+void WebKitClientImpl::notifyJSOutOfMemory(WebCore::Frame* frame) {
+ if (!frame)
+ return;
+
+ WebFrameImpl* webframe = WebFrameImpl::FromFrame(frame);
+ if (!webframe->client())
+ return;
+ webframe->client()->didExhaustMemoryAvailableForScript(webframe);
+}
+
+bool WebKitClientImpl::popupsAllowed(NPP npp) {
+ bool popups_allowed = false;
+ if (npp) {
+ NPAPI::PluginInstance* plugin_instance =
+ reinterpret_cast<NPAPI::PluginInstance*>(npp->ndata);
+ if (plugin_instance)
+ popups_allowed = plugin_instance->popups_allowed();
+ }
+ return popups_allowed;
+}
+
+WebCore::String WebKitClientImpl::uiResourceProtocol() {
+ return StdStringToString(webkit_glue::GetUIResourceProtocol());
+}
+
+int WebKitClientImpl::screenDepth(WebCore::Widget* widget) {
+ WebKit::WebWidgetClient* client = ToWebWidgetClient(widget);
+ if (!client)
+ return 0;
+ return client->screenInfo().depth;
+}
+
+int WebKitClientImpl::screenDepthPerComponent(WebCore::Widget* widget) {
+ WebKit::WebWidgetClient* client = ToWebWidgetClient(widget);
+ if (!client)
+ return 0;
+ return client->screenInfo().depthPerComponent;
+}
+
+bool WebKitClientImpl::screenIsMonochrome(WebCore::Widget* widget) {
+ WebKit::WebWidgetClient* client = ToWebWidgetClient(widget);
+ if (!client)
+ return false;
+ return client->screenInfo().isMonochrome;
+}
+
+WebCore::IntRect WebKitClientImpl::screenRect(WebCore::Widget* widget) {
+ WebKit::WebWidgetClient* client = ToWebWidgetClient(widget);
+ if (!client)
+ return WebCore::IntRect();
+ return ToIntRect(client->screenInfo().rect);
+}
+
+WebCore::IntRect WebKitClientImpl::screenAvailableRect(
+ WebCore::Widget* widget) {
+ WebKit::WebWidgetClient* client = ToWebWidgetClient(widget);
+ if (!client)
+ return WebCore::IntRect();
+ return ToIntRect(client->screenInfo().availableRect);
+}
+
+void WebKitClientImpl::widgetSetCursor(WebCore::Widget* widget,
+ const WebCore::Cursor& cursor) {
+ ChromeClientImpl* chrome_client = ToChromeClient(widget);
+ if (chrome_client)
+ chrome_client->SetCursor(CursorToWebCursorInfo(cursor));
+}
+
+void WebKitClientImpl::widgetSetFocus(WebCore::Widget* widget) {
+ ChromeClientImpl* chrome_client = ToChromeClient(widget);
+ if (chrome_client)
+ chrome_client->focus();
+}
+
+WebCore::WorkerContextProxy* WebKitClientImpl::createWorkerContextProxy(
+ WebCore::Worker* worker) {
+ return WebWorkerClientImpl::createWorkerContextProxy(worker);
+}
+} // namespace webkit_glue \ No newline at end of file
diff --git a/webkit/glue/webkitclient_impl.h b/webkit/glue/webkitclient_impl.h
index 829b162..1c4a177 100644
--- a/webkit/glue/webkitclient_impl.h
+++ b/webkit/glue/webkitclient_impl.h
@@ -62,6 +62,24 @@ class WebKitClientImpl : public WebKit::WebKitClient {
virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
WebKit::WebApplicationCacheHostClient*);
+ // These are temporary methods that the WebKit layer can use to call to the
+ // Glue layer. Once the Glue layer moves entirely into the WebKit layer,
+ // these methods will be deleted.
+ virtual WebKit::WebMediaPlayer* createWebMediaPlayer(
+ WebKit::WebMediaPlayerClient*, WebCore::Frame*);
+ virtual void setCursorForPlugin(const WebKit::WebCursorInfo&, WebCore::Frame*);
+ virtual WebCore::String uiResourceProtocol();
+ virtual void notifyJSOutOfMemory(WebCore::Frame*);
+ virtual int screenDepth(WebCore::Widget*);
+ virtual int screenDepthPerComponent(WebCore::Widget*);
+ virtual bool screenIsMonochrome(WebCore::Widget*);
+ virtual WebCore::IntRect screenRect(WebCore::Widget*);
+ virtual WebCore::IntRect screenAvailableRect(WebCore::Widget*);
+ virtual bool popupsAllowed(NPP);
+ virtual void widgetSetCursor(WebCore::Widget*, const WebCore::Cursor&);
+ virtual void widgetSetFocus(WebCore::Widget*);
+ virtual WebCore::WorkerContextProxy* createWorkerContextProxy(WebCore::Worker* worker);
+
private:
void DoTimeout() {
if (shared_timer_func_)
diff --git a/webkit/glue/webworkerclient_impl.cc b/webkit/glue/webworkerclient_impl.cc
index f6bcfb3..69a291c 100644
--- a/webkit/glue/webworkerclient_impl.cc
+++ b/webkit/glue/webworkerclient_impl.cc
@@ -37,6 +37,7 @@
#include "webkit/glue/glue_util.h"
#include "webkit/glue/webframeloaderclient_impl.h"
#include "webkit/glue/webframe_impl.h"
+#include "webkit/glue/webkitclient_impl.h"
#include "webkit/glue/webview_delegate.h"
#include "webkit/glue/webview_impl.h"
#include "webkit/glue/webworker_impl.h"
@@ -59,7 +60,9 @@ using WebKit::WebWorkerClient;
//
// Note that if we're running each worker in a separate process, then nested
// workers end up using the same codepath as the renderer process.
-WebCore::WorkerContextProxy* WebCore::WorkerContextProxy::create(
+
+// static
+WebCore::WorkerContextProxy* WebWorkerClientImpl::createWorkerContextProxy(
WebCore::Worker* worker) {
if (!worker->scriptExecutionContext()->isDocument() &&
CommandLine::ForCurrentProcess()->HasSwitch(
@@ -96,7 +99,6 @@ WebCore::WorkerContextProxy* WebCore::WorkerContextProxy::create(
return proxy;
}
-
WebWorkerClientImpl::WebWorkerClientImpl(WebCore::Worker* worker)
: script_execution_context_(worker->scriptExecutionContext()),
worker_(worker),
diff --git a/webkit/glue/webworkerclient_impl.h b/webkit/glue/webworkerclient_impl.h
index 75310f4..8c75377 100644
--- a/webkit/glue/webworkerclient_impl.h
+++ b/webkit/glue/webworkerclient_impl.h
@@ -29,6 +29,10 @@ class WebWorkerClientImpl : public WebCore::WorkerContextProxy,
public:
WebWorkerClientImpl(WebCore::Worker* worker);
+ // WebCore::WorkerContextProxy Factory.
+ static WebCore::WorkerContextProxy* createWorkerContextProxy(
+ WebCore::Worker* worker);
+
void set_webworker(WebKit::WebWorker* webworker);
// WebCore::WorkerContextProxy methods:
diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp
index 66c3722..9a8e479 100644
--- a/webkit/webkit.gyp
+++ b/webkit/webkit.gyp
@@ -1384,7 +1384,6 @@
'glue/back_forward_list_client_impl.h',
'glue/chrome_client_impl.cc',
'glue/chrome_client_impl.h',
- 'glue/chromium_bridge_impl.cc',
'glue/context_menu.h',
'glue/context_menu_client_impl.cc',
'glue/context_menu_client_impl.h',
@@ -1440,7 +1439,6 @@
'glue/searchable_form_data.h',
'glue/simple_webmimeregistry_impl.cc',
'glue/simple_webmimeregistry_impl.h',
- 'glue/temporary_glue.cc',
'glue/webaccessibility.h',
'glue/webaccessibilitymanager.h',
'glue/webaccessibilitymanager_impl.cc',