Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: webkit/glue/webworker_impl.cc

Issue 200054: Hook up WebFrameClient, replacing many WebViewDelegate methods.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webview_impl.cc ('k') | webkit/glue/webworkerclient_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webworker_impl.cc
===================================================================
--- webkit/glue/webworker_impl.cc (revision 25715)
+++ webkit/glue/webworker_impl.cc (working copy)
@@ -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 @@
// 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 @@
// 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());
« no previous file with comments | « webkit/glue/webview_impl.cc ('k') | webkit/glue/webworkerclient_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698