diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 20:00:22 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 20:00:22 +0000 |
commit | c88a70fe5a69daf5d3d6e0599ed273d160b55c41 (patch) | |
tree | b0c2303575c6f9d5f6d42e1716fbdc5decdd139e /chrome/browser | |
parent | 0302e4ac5907fcdaafbf2a883b29496032c0db19 (diff) | |
download | chromium_src-c88a70fe5a69daf5d3d6e0599ed273d160b55c41.zip chromium_src-c88a70fe5a69daf5d3d6e0599ed273d160b55c41.tar.gz chromium_src-c88a70fe5a69daf5d3d6e0599ed273d160b55c41.tar.bz2 |
Plumb the creator URL for popups up to the browser. We don't yet use this for anything; it will be used for whitelisting popups by hostname.
BUG=11440
Review URL: http://codereview.chromium.org/105004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rwxr-xr-x | chrome/browser/extensions/extension_host.cc | 3 | ||||
-rwxr-xr-x | chrome/browser/extensions/extension_host.h | 3 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 9 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.h | 3 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host_delegate.h | 3 | ||||
-rw-r--r-- | chrome/browser/tab_contents/interstitial_page.cc | 5 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 3 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 3 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_view.cc | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_view.h | 3 | ||||
-rw-r--r-- | chrome/browser/views/blocked_popup_container.cc | 4 |
11 files changed, 28 insertions, 17 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 4e5f615a..7f6bd01 100755 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -124,7 +124,8 @@ void ExtensionHost::CreateNewWidget(int route_id, bool activatable) { void ExtensionHost::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture) { + bool user_gesture, + const GURL& creator_url) { TabContents* contents = delegate_view_helper_.GetCreatedWindow(route_id); if (contents) { // TODO(erikkay) is it safe to pass in NULL as source? diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h index 9e90522..6a80cb4 100755 --- a/chrome/browser/extensions/extension_host.h +++ b/chrome/browser/extensions/extension_host.h @@ -63,7 +63,8 @@ class ExtensionHost : public RenderViewHostDelegate, virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture); + bool user_gesture, + const GURL& creator_url); virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); virtual void ShowContextMenu(const ContextMenuParams& params); diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 7d19fe3..8991f5f 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -828,10 +828,13 @@ void RenderViewHost::CreateNewWidget(int route_id, bool activatable) { void RenderViewHost::OnMsgShowView(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture) { + bool user_gesture, + const GURL& creator_url) { RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); - if (view) - view->ShowCreatedWindow(route_id, disposition, initial_pos, user_gesture); + if (view) { + view->ShowCreatedWindow(route_id, disposition, initial_pos, user_gesture, + creator_url); + } } void RenderViewHost::OnMsgShowWidget(int route_id, diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 50b5dff..9755b50 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -431,7 +431,8 @@ class RenderViewHost : public RenderWidgetHost { void OnMsgShowView(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture); + bool user_gesture, + const GURL& creator_url); void OnMsgShowWidget(int route_id, const gfx::Rect& initial_pos); void OnMsgRunModal(IPC::Message* reply_msg); void OnMsgRenderViewReady(); diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index 14a1da0..a3fe299 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -88,7 +88,8 @@ class RenderViewHostDelegate { virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture) = 0; + bool user_gesture, + const GURL& creator_url) = 0; // Show the newly created widget with the specified bounds. // The widget is identified by the route_id passed to CreateNewWidget. diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index 9384988..e0106aa 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -76,7 +76,8 @@ class InterstitialPage::InterstitialPageRVHViewDelegate virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture); + bool user_gesture, + const GURL& creator_url); virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); virtual void ShowContextMenu(const ContextMenuParams& params); @@ -473,7 +474,7 @@ void InterstitialPage::InterstitialPageRVHViewDelegate::CreateNewWidget( void InterstitialPage::InterstitialPageRVHViewDelegate::ShowCreatedWindow( int route_id, WindowOpenDisposition disposition, - const gfx::Rect& initial_pos, bool user_gesture) { + const gfx::Rect& initial_pos, bool user_gesture, const GURL& creator_url) { NOTREACHED() << "InterstitialPage does not support showing popups yet."; } diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 3712fc4..92d5584 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -774,7 +774,8 @@ ConstrainedWindow* TabContents::CreateConstrainedDialog( void TabContents::AddNewContents(TabContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture) { + bool user_gesture, + const GURL& creator_url) { if (!delegate_) return; diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 0497fdd..cb7e589 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -332,7 +332,8 @@ class TabContents : public PageNavigator, void AddNewContents(TabContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture); + bool user_gesture, + const GURL& creator_url); // Builds a ConstrainedWindow* for the incoming |new_contents| and // adds it to child_windows_. diff --git a/chrome/browser/tab_contents/tab_contents_view.cc b/chrome/browser/tab_contents/tab_contents_view.cc index da6c894..402876d 100644 --- a/chrome/browser/tab_contents/tab_contents_view.cc +++ b/chrome/browser/tab_contents/tab_contents_view.cc @@ -35,11 +35,12 @@ void TabContentsView::CreateNewWidget(int route_id, bool activatable) { void TabContentsView::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture) { + bool user_gesture, + const GURL& creator_url) { TabContents* contents = delegate_view_helper_.GetCreatedWindow(route_id); if (contents) { tab_contents()->AddNewContents(contents, disposition, initial_pos, - user_gesture); + user_gesture, creator_url); } } @@ -65,4 +66,3 @@ void TabContentsView::ShowCreatedWidgetInternal( initial_pos); widget_host_view->GetRenderWidgetHost()->Init(); } - diff --git a/chrome/browser/tab_contents/tab_contents_view.h b/chrome/browser/tab_contents/tab_contents_view.h index 1887f13..2af4902 100644 --- a/chrome/browser/tab_contents/tab_contents_view.h +++ b/chrome/browser/tab_contents/tab_contents_view.h @@ -154,7 +154,8 @@ class TabContentsView : public RenderViewHostDelegate::View { virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture); + bool user_gesture, + const GURL& creator_url); virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); // The TabContents whose contents we display. diff --git a/chrome/browser/views/blocked_popup_container.cc b/chrome/browser/views/blocked_popup_container.cc index 37b42f3..4fa0505 100644 --- a/chrome/browser/views/blocked_popup_container.cc +++ b/chrome/browser/views/blocked_popup_container.cc @@ -285,7 +285,7 @@ void BlockedPopupContainer::LaunchPopupIndex(int index) { // Pass this TabContents back to our owner, forcing the window to be // displayed since user_gesture is true. - owner_->AddNewContents(contents, NEW_POPUP, bounds, true); + owner_->AddNewContents(contents, NEW_POPUP, bounds, true, GURL()); } if (blocked_popups_.size() == 0) @@ -357,7 +357,7 @@ void BlockedPopupContainer::AddNewContents(TabContents* source, const gfx::Rect& initial_position, bool user_gesture) { owner_->AddNewContents(new_contents, disposition, initial_position, - user_gesture); + user_gesture, GURL()); } void BlockedPopupContainer::CloseContents(TabContents* source) { |