diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-10 04:29:17 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-10 04:29:17 +0000 |
commit | 3d96893747d18a3c1bf06084d4605a4b34af732f (patch) | |
tree | 9347442c4dd581ab825ed22cddc082e6119000e4 /webkit/glue/webworker_impl.cc | |
parent | 47b0ee174aa53dd1fd473bafae35166538f57a68 (diff) | |
download | chromium_src-3d96893747d18a3c1bf06084d4605a4b34af732f.zip chromium_src-3d96893747d18a3c1bf06084d4605a4b34af732f.tar.gz chromium_src-3d96893747d18a3c1bf06084d4605a4b34af732f.tar.bz2 |
Hook up WebFrameClient, replacing many WebViewDelegate methods.
Moved NavigationGesture out of webview_delegate.h into its own
header in chrome/common since it is only needed by Chrome.
Adds WebFrame::isProcessingUserGesture to facilitate the removal
of NavigationGesture.
Cleaned up some TestShell methods related to URL loading. The
method to load an URL now takes a GURL instead of a wchar_t*.
R=dglazkov
BUG=21332
TEST=none
Review URL: http://codereview.chromium.org/200054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25841 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webworker_impl.cc')
-rw-r--r-- | webkit/glue/webworker_impl.cc | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/webkit/glue/webworker_impl.cc b/webkit/glue/webworker_impl.cc index 60fe5d0..b5a7861 100644 --- a/webkit/glue/webworker_impl.cc +++ b/webkit/glue/webworker_impl.cc @@ -21,6 +21,7 @@ #undef LOG #include "base/logging.h" +#include "webkit/api/public/WebFrameClient.h" #include "webkit/api/public/WebMessagePortChannel.h" #include "webkit/api/public/WebScreenInfo.h" #include "webkit/api/public/WebString.h" @@ -28,6 +29,7 @@ #include "webkit/api/public/WebWorkerClient.h" #include "webkit/api/src/PlatformMessagePortChannel.h" #include "webkit/api/src/WebDataSourceImpl.h" +#include "webkit/glue/empty_webframeclient.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/webframe_impl.h" #include "webkit/glue/webpreferences.h" @@ -36,7 +38,10 @@ #include "webkit/glue/webworker_impl.h" using WebKit::WebCursorInfo; +using WebKit::WebDataSource; +using WebKit::WebDataSourceImpl; using WebKit::WebFrame; +using WebKit::WebFrameClient; using WebKit::WebMessagePortChannel; using WebKit::WebMessagePortChannelArray; using WebKit::WebNavigationPolicy; @@ -51,39 +56,22 @@ using WebKit::WebWorkerClient; // Dummy WebViewDelegate - we only need it in Worker process to load a // 'shadow page' which will initialize WebCore loader. -class WorkerWebViewDelegate : public WebViewDelegate { +class WorkerWebFrameClient : public webkit_glue::EmptyWebFrameClient { public: - WorkerWebViewDelegate() {} - - virtual void didInvalidateRect(const WebRect&) {} - virtual void didScrollRect(int dx, int dy, const WebRect& clipRect) {} - virtual void didFocus() {} - virtual void didBlur() {} - virtual void didChangeCursor(const WebCursorInfo&) {} - virtual void closeWidgetSoon() {} - virtual void show(WebNavigationPolicy) {} - virtual void runModal() {} - virtual WebRect windowRect() { return WebRect(); } - virtual void setWindowRect(const WebRect&) {} - virtual WebRect windowResizerRect() { return WebRect(); } - virtual WebRect rootWindowRect() { return WebRect(); } - virtual WebScreenInfo screenInfo() { return WebScreenInfo(); } - // Tell the loader to load the data into the 'shadow page' synchronously, // so we can grab the resulting Document right after load. - virtual void DidCreateDataSource(WebFrame* frame, WebKit::WebDataSource* ds) { - static_cast<WebKit::WebDataSourceImpl*>(ds)-> - setDeferMainResourceDataLoad(false); + virtual void didCreateDataSource(WebFrame* frame, WebDataSource* ds) { + static_cast<WebDataSourceImpl*>(ds)->setDeferMainResourceDataLoad(false); } // Lazy allocate and leak this instance. - static WorkerWebViewDelegate* worker_delegate() { - static WorkerWebViewDelegate* worker_delegate = new WorkerWebViewDelegate(); - return worker_delegate; + static WorkerWebFrameClient* GetSharedInstance() { + static WorkerWebFrameClient client; + return &client; } private: - DISALLOW_COPY_AND_ASSIGN(WorkerWebViewDelegate); + WorkerWebFrameClient() {} }; namespace WebKit { @@ -149,9 +137,9 @@ void WebWorkerImpl::startWorkerContext(const WebURL& script_url, // loading requests from the worker context to the rest of WebKit and Chromium // infrastructure. DCHECK(!web_view_); - web_view_ = WebView::Create(WorkerWebViewDelegate::worker_delegate(), NULL); + web_view_ = WebView::Create(NULL, NULL); WebPreferences().Apply(web_view_); - web_view_->InitializeMainFrame(); + web_view_->InitializeMainFrame(WorkerWebFrameClient::GetSharedInstance()); WebFrameImpl* web_frame = static_cast<WebFrameImpl*>(web_view_->GetMainFrame()); |