summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-15 09:05:49 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-15 09:05:49 +0000
commit1c642b53fd4945309ae8f878617f491b92ad505e (patch)
tree8abeb23a179667cb8805f8c1bfabf6b92610d1c0 /content
parentd08a925de1e2b96c68bf6ca341512e18d3098a9b (diff)
downloadchromium_src-1c642b53fd4945309ae8f878617f491b92ad505e.zip
chromium_src-1c642b53fd4945309ae8f878617f491b92ad505e.tar.gz
chromium_src-1c642b53fd4945309ae8f878617f491b92ad505e.tar.bz2
Also fire onBeforeRetarget events if now tabs/windows are opened due to user actions.
BUG=none TEST=api tests Review URL: http://codereview.chromium.org/6627040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81717 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/tab_contents/tab_contents.cc6
-rw-r--r--content/browser/tab_contents/tab_contents_observer.cc6
-rw-r--r--content/browser/tab_contents/tab_contents_observer.h6
3 files changed, 17 insertions, 1 deletions
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 71a7644..5ca1e0f 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -646,8 +646,12 @@ bool TabContents::NeedToFireBeforeUnload() {
void TabContents::OpenURL(const GURL& url, const GURL& referrer,
WindowOpenDisposition disposition,
PageTransition::Type transition) {
- if (delegate_)
+ if (delegate_) {
delegate_->OpenURLFromTab(this, url, referrer, disposition, transition);
+ // Notify observers.
+ FOR_EACH_OBSERVER(TabContentsObserver, observers_,
+ DidOpenURL(url, referrer, disposition, transition));
+ }
}
bool TabContents::NavigateToPendingEntry(
diff --git a/content/browser/tab_contents/tab_contents_observer.cc b/content/browser/tab_contents/tab_contents_observer.cc
index d045792..50bf910 100644
--- a/content/browser/tab_contents/tab_contents_observer.cc
+++ b/content/browser/tab_contents/tab_contents_observer.cc
@@ -79,6 +79,12 @@ void TabContentsObserver::RenderViewGone() {
void TabContentsObserver::StopNavigation() {
}
+void TabContentsObserver::DidOpenURL(const GURL& url,
+ const GURL& referrer,
+ WindowOpenDisposition disposition,
+ PageTransition::Type transition) {
+}
+
TabContentsObserver::TabContentsObserver(TabContents* tab_contents) {
SetTabContents(tab_contents);
tab_contents_->AddObserver(this);
diff --git a/content/browser/tab_contents/tab_contents_observer.h b/content/browser/tab_contents/tab_contents_observer.h
index 87694d8..bfe7760 100644
--- a/content/browser/tab_contents/tab_contents_observer.h
+++ b/content/browser/tab_contents/tab_contents_observer.h
@@ -8,6 +8,7 @@
#include "content/browser/tab_contents/navigation_controller.h"
#include "content/common/page_transition_types.h"
#include "ipc/ipc_channel.h"
+#include "webkit/glue/window_open_disposition.h"
struct ViewHostMsg_FrameNavigate_Params;
@@ -66,6 +67,11 @@ class TabContentsObserver : public IPC::Channel::Listener,
virtual void RenderViewGone();
virtual void StopNavigation();
+ virtual void DidOpenURL(const GURL& url,
+ const GURL& referrer,
+ WindowOpenDisposition disposition,
+ PageTransition::Type transition);
+
#if 0
// For unifying with delegate...