summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 22:08:38 +0000
committerkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 22:08:38 +0000
commiteb0bff94e83fb3d6829cc9fe01468fdce672e7c3 (patch)
treefd4c174cc8e8032ee74afd6fede881883dabf982 /content
parent4aa70db622005c8041be5228a628167a17e3b019 (diff)
downloadchromium_src-eb0bff94e83fb3d6829cc9fe01468fdce672e7c3.zip
chromium_src-eb0bff94e83fb3d6829cc9fe01468fdce672e7c3.tar.gz
chromium_src-eb0bff94e83fb3d6829cc9fe01468fdce672e7c3.tar.bz2
Adds TabContents/RenderView observers for automation/testing messages.
The RenderViewObserver currently sends two messages to the browser related to tracking client redirects, which is needed for determining whether to wait for a future navigation. This is particularly needed to wait correctly in chromedriver for form submissions and javascript redirects. However, timed redirects still need to be considered. BUG=none TEST=none Review URL: http://codereview.chromium.org/6676136 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80848 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/renderer/render_view.cc9
-rw-r--r--content/renderer/render_view_observer.h7
2 files changed, 14 insertions, 2 deletions
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index 15aba9e..3392c97 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -2796,17 +2796,22 @@ void RenderView::willSubmitForm(WebFrame* frame, const WebFormElement& form) {
void RenderView::willPerformClientRedirect(
WebFrame* frame, const WebURL& from, const WebURL& to, double interval,
double fire_time) {
- // Ignore
+ FOR_EACH_OBSERVER(
+ RenderViewObserver, observers_,
+ WillPerformClientRedirect(frame, from, to, interval, fire_time));
}
void RenderView::didCancelClientRedirect(WebFrame* frame) {
- // Ignore
+ FOR_EACH_OBSERVER(
+ RenderViewObserver, observers_, DidCancelClientRedirect(frame));
}
void RenderView::didCompleteClientRedirect(
WebFrame* frame, const WebURL& from) {
if (!frame->parent())
completed_client_redirect_src_ = from;
+ FOR_EACH_OBSERVER(
+ RenderViewObserver, observers_, DidCompleteClientRedirect(frame, from));
}
void RenderView::didCreateDataSource(WebFrame* frame, WebDataSource* ds) {
diff --git a/content/renderer/render_view_observer.h b/content/renderer/render_view_observer.h
index f82fc17..8ccac5a 100644
--- a/content/renderer/render_view_observer.h
+++ b/content/renderer/render_view_observer.h
@@ -16,6 +16,7 @@ class WebDataSource;
class WebFrame;
class WebFormElement;
class WebMouseEvent;
+class WebURL;
struct WebURLError;
}
@@ -38,6 +39,12 @@ class RenderViewObserver : public IPC::Channel::Listener,
const WebKit::WebURLError& error) {}
virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame,
bool is_new_navigation) {}
+ virtual void WillPerformClientRedirect(
+ WebKit::WebFrame* frame, const WebKit::WebURL& from,
+ const WebKit::WebURL& to, double interval, double fire_time) {}
+ virtual void DidCancelClientRedirect(WebKit::WebFrame* frame) {}
+ virtual void DidCompleteClientRedirect(WebKit::WebFrame* frame,
+ const WebKit::WebURL& from) {}
virtual void DidCreateDocumentElement(WebKit::WebFrame* frame) {}
virtual void FrameDetached(WebKit::WebFrame* frame) {}
virtual void FrameWillClose(WebKit::WebFrame* frame) {}