From 0afe827a49501c6801c3c9efbbdb1f64aa010beb Mon Sep 17 00:00:00 2001 From: "aa@chromium.org" Date: Sat, 14 Feb 2009 04:15:16 +0000 Subject: Add early-injection capability to user scripts. Review URL: http://codereview.chromium.org/19624 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9822 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/webframeloaderclient_impl.cc | 6 ++++-- webkit/glue/webview_delegate.h | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'webkit') diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc index aaf3500..f8acc50 100644 --- a/webkit/glue/webframeloaderclient_impl.cc +++ b/webkit/glue/webframeloaderclient_impl.cc @@ -101,8 +101,10 @@ void WebFrameLoaderClient::windowObjectCleared() { } void WebFrameLoaderClient::documentElementAvailable() { - // TODO(aa): Implement. - notImplemented(); + WebViewImpl* webview = webframe_->webview_impl(); + WebViewDelegate* d = webview->delegate(); + if (d) + d->DocumentElementAvailable(webframe_); } void WebFrameLoaderClient::didPerformFirstNavigation() const { diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h index 2fe2351..892c25e 100644 --- a/webkit/glue/webview_delegate.h +++ b/webkit/glue/webview_delegate.h @@ -198,6 +198,12 @@ class WebViewDelegate : virtual public WebWidgetDelegate { virtual void WindowObjectCleared(WebFrame* webframe) { } + // Notifies that the documentElement for the document in a webframe has been + // created. This is called before anything else is parsed or executed for the + // document. + virtual void DocumentElementAvailable(WebFrame* webframe) { + } + // PolicyDelegate ---------------------------------------------------------- // This method is called to notify the delegate, and let it modify a -- cgit v1.1