diff options
19 files changed, 52 insertions, 69 deletions
diff --git a/chrome/browser/blocked_popup_container.cc b/chrome/browser/blocked_popup_container.cc index bf7a08a..cb48a98 100644 --- a/chrome/browser/blocked_popup_container.cc +++ b/chrome/browser/blocked_popup_container.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this +// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this // source code is governed by a BSD-style license that can be found in the // LICENSE file. @@ -44,7 +44,7 @@ void BlockedPopupContainer::AddTabContents(TabContents* tab_contents, // Show whitelisted popups immediately. bool whitelisted = !!whitelist_.count(host); if (whitelisted) - owner_->AddNewContents(tab_contents, NEW_POPUP, bounds, true, GURL()); + owner_->AddNewContents(tab_contents, NEW_POPUP, bounds, true); if (has_been_dismissed_) { // Don't want to show any other UI. @@ -91,7 +91,7 @@ void BlockedPopupContainer::LaunchPopupAtIndex(size_t index) { BlockedPopups::iterator i(blocked_popups_.begin() + index); TabContents* tab_contents = i->tab_contents; tab_contents->set_delegate(NULL); - owner_->AddNewContents(tab_contents, NEW_POPUP, i->bounds, true, GURL()); + owner_->AddNewContents(tab_contents, NEW_POPUP, i->bounds, true); const std::string& host = i->host; if (!host.empty()) { @@ -254,7 +254,7 @@ void BlockedPopupContainer::AddNewContents(TabContents* source, const gfx::Rect& initial_position, bool user_gesture) { owner_->AddNewContents(new_contents, disposition, initial_position, - user_gesture, GURL()); + user_gesture); } void BlockedPopupContainer::CloseContents(TabContents* source) { diff --git a/chrome/browser/chromeos/main_menu.cc b/chrome/browser/chromeos/main_menu.cc index eae51c9..452f412 100644 --- a/chrome/browser/chromeos/main_menu.cc +++ b/chrome/browser/chromeos/main_menu.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -271,13 +271,11 @@ void MainMenu::CreateNewWindow(int route_id) { void MainMenu::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url) { + bool user_gesture) { if (disposition == NEW_POPUP) { pending_contents_->set_delegate(NULL); browser_->GetSelectedTabContents()->AddNewContents( - pending_contents_.release(), disposition, initial_pos, user_gesture, - creator_url); + pending_contents_.release(), disposition, initial_pos, user_gesture); Hide(); } } diff --git a/chrome/browser/chromeos/main_menu.h b/chrome/browser/chromeos/main_menu.h index 49217e2..359c120 100644 --- a/chrome/browser/chromeos/main_menu.h +++ b/chrome/browser/chromeos/main_menu.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -153,8 +153,7 @@ class MainMenu : public RenderViewHostDelegate, virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url); + bool user_gesture); virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) {} virtual void ShowContextMenu(const ContextMenuParams& params) {} diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index e7ca8f0..a600235 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -481,8 +481,7 @@ RenderWidgetHostView* ExtensionHost::CreateNewWidgetInternal(int route_id, void ExtensionHost::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url) { + bool user_gesture) { TabContents* contents = delegate_view_helper_.GetCreatedWindow(route_id); if (contents) { Browser* browser = GetBrowser(); diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h index 5f2188c..4087338 100644 --- a/chrome/browser/extensions/extension_host.h +++ b/chrome/browser/extensions/extension_host.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -130,8 +130,7 @@ class ExtensionHost : public ExtensionPopupHost::PopupDelegate, virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url); + bool user_gesture); virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); virtual void ShowContextMenu(const ContextMenuParams& params); diff --git a/chrome/browser/gtk/notifications/balloon_view_host_gtk.cc b/chrome/browser/gtk/notifications/balloon_view_host_gtk.cc index d80b202..b8f3e96 100644 --- a/chrome/browser/gtk/notifications/balloon_view_host_gtk.cc +++ b/chrome/browser/gtk/notifications/balloon_view_host_gtk.cc @@ -99,8 +99,7 @@ void BalloonViewHost::CreateNewWindow(int route_id) { void BalloonViewHost::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url) { + bool user_gesture) { // Don't allow pop-ups from notifications. if (disposition == NEW_POPUP) return; diff --git a/chrome/browser/gtk/notifications/balloon_view_host_gtk.h b/chrome/browser/gtk/notifications/balloon_view_host_gtk.h index 957ef97..0c40864 100644 --- a/chrome/browser/gtk/notifications/balloon_view_host_gtk.h +++ b/chrome/browser/gtk/notifications/balloon_view_host_gtk.h @@ -74,8 +74,7 @@ class BalloonViewHost : public RenderViewHostDelegate, virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url); + bool user_gesture); 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 7a89215..bdda310 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -858,12 +858,10 @@ void RenderViewHost::CreateNewWidget(int route_id, bool activatable) { void RenderViewHost::OnMsgShowView(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url) { + bool user_gesture) { RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); if (view) { - view->ShowCreatedWindow(route_id, disposition, initial_pos, user_gesture, - creator_url); + view->ShowCreatedWindow(route_id, disposition, initial_pos, user_gesture); Send(new ViewMsg_Move_ACK(route_id)); } } diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 2201b80..9a37a39 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -452,8 +452,7 @@ class RenderViewHost : public RenderWidgetHost { void OnMsgShowView(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url); + bool user_gesture); 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 205c2d0..680ff0f 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -97,8 +97,7 @@ class RenderViewHostDelegate { virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url) = 0; + bool user_gesture) = 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 f6db824..217ec0d 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -90,8 +90,7 @@ class InterstitialPage::InterstitialPageRVHViewDelegate virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url); + bool user_gesture); virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); virtual void ShowContextMenu(const ContextMenuParams& params); @@ -551,7 +550,7 @@ void InterstitialPage::InterstitialPageRVHViewDelegate::CreateNewWidget( void InterstitialPage::InterstitialPageRVHViewDelegate::ShowCreatedWindow( int route_id, WindowOpenDisposition disposition, - const gfx::Rect& initial_pos, bool user_gesture, const GURL& creator_url) { + const gfx::Rect& initial_pos, bool user_gesture) { 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 27c215e..2f94369 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -789,8 +789,7 @@ void TabContents::BlockTabContent(bool blocked) { void TabContents::AddNewContents(TabContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url) { + bool user_gesture) { if (!delegate_) return; @@ -799,9 +798,8 @@ void TabContents::AddNewContents(TabContents* new_contents, switches::kDisablePopupBlocking)) { // Unrequested popups from normal pages are constrained unless they're in // the whitelist. The popup owner will handle checking this. - delegate_->GetConstrainingContents(this)->AddPopup(new_contents, - initial_pos, - creator_url.is_valid() ? creator_url.host() : std::string()); + delegate_->GetConstrainingContents(this)->AddPopup( + new_contents, initial_pos); } else { #if defined(OS_CHROMEOS) if (disposition == NEW_POPUP) { @@ -1257,10 +1255,14 @@ void TabContents::CreateBlockedPopupContainerIfNecessary() { } void TabContents::AddPopup(TabContents* new_contents, - const gfx::Rect& initial_pos, - const std::string& host) { + const gfx::Rect& initial_pos) { CreateBlockedPopupContainerIfNecessary(); - blocked_popups_->AddTabContents(new_contents, initial_pos, host); + // A popup is associated with the toplevel site instead of a potential frame + // that spawns it. + const GURL& url = GetURL(); + blocked_popups_->AddTabContents( + new_contents, initial_pos, + url.is_valid() ? url.host() : std::string()); } // TODO(brettw) This should be on the TabContentsView. diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 2ea5bf5..d78f150 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -358,8 +358,7 @@ class TabContents : public PageNavigator, void AddNewContents(TabContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url); + bool user_gesture); // Closes all constrained windows that represent web popups that have not yet // been activated by the user and are as such auto-positioned in the bottom @@ -698,8 +697,7 @@ class TabContents : public PageNavigator, // Adds the incoming |new_contents| to the |blocked_popups_| container. void AddPopup(TabContents* new_contents, - const gfx::Rect& initial_pos, - const std::string& host); + const gfx::Rect& initial_pos); // Called by a derived class when the TabContents is resized, causing // suppressed constrained web popups to be repositioned to the new bounds diff --git a/chrome/browser/tab_contents/tab_contents_view.cc b/chrome/browser/tab_contents/tab_contents_view.cc index 533e6dc..9b50bdb 100644 --- a/chrome/browser/tab_contents/tab_contents_view.cc +++ b/chrome/browser/tab_contents/tab_contents_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -42,12 +42,11 @@ void TabContentsView::CreateNewWidget(int route_id, bool activatable) { void TabContentsView::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url) { + bool user_gesture) { TabContents* contents = delegate_view_helper_.GetCreatedWindow(route_id); if (contents) { tab_contents()->AddNewContents(contents, disposition, initial_pos, - user_gesture, creator_url); + user_gesture); } } diff --git a/chrome/browser/tab_contents/tab_contents_view.h b/chrome/browser/tab_contents/tab_contents_view.h index a7ca049..5380fb0 100644 --- a/chrome/browser/tab_contents/tab_contents_view.h +++ b/chrome/browser/tab_contents/tab_contents_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -183,8 +183,7 @@ class TabContentsView : public RenderViewHostDelegate::View { virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url); + bool user_gesture); virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); // The TabContents whose contents we display. diff --git a/chrome/browser/views/notifications/balloon_view_host.cc b/chrome/browser/views/notifications/balloon_view_host.cc index 0a02d63..df074b0 100644 --- a/chrome/browser/views/notifications/balloon_view_host.cc +++ b/chrome/browser/views/notifications/balloon_view_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -83,8 +83,7 @@ void BalloonViewHost::CreateNewWindow(int route_id) { void BalloonViewHost::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url) { + bool user_gesture) { // Don't allow pop-ups from notifications. if (disposition == NEW_POPUP) return; diff --git a/chrome/browser/views/notifications/balloon_view_host.h b/chrome/browser/views/notifications/balloon_view_host.h index 884dc26..4233122 100644 --- a/chrome/browser/views/notifications/balloon_view_host.h +++ b/chrome/browser/views/notifications/balloon_view_host.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -65,8 +65,7 @@ class BalloonViewHost : public views::NativeViewHost, virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, - bool user_gesture, - const GURL& creator_url); + bool user_gesture); virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) {} virtual void ShowContextMenu(const ContextMenuParams& params) {} diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index c46af28..2feba45 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -880,12 +880,11 @@ IPC_BEGIN_MESSAGES(ViewHost) // // FUTURE: there will probably be flags here to control if the result is // in a new window. - IPC_MESSAGE_ROUTED5(ViewHostMsg_ShowView, + IPC_MESSAGE_ROUTED4(ViewHostMsg_ShowView, int /* route_id */, WindowOpenDisposition /* disposition */, gfx::Rect /* initial_pos */, - bool /* opened_by_user_gesture */, - GURL /* creator_url */) + bool /* opened_by_user_gesture */) IPC_MESSAGE_ROUTED2(ViewHostMsg_ShowWidget, int /* route_id */, diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index e56673ed..784849d 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -1883,7 +1883,7 @@ void RenderView::show(WebNavigationPolicy policy) { // browser process will impose a default position otherwise. Send(new ViewHostMsg_ShowView(opener_id_, routing_id_, NavigationPolicyToDisposition(policy), initial_pos_, - opened_by_user_gesture_, creator_url_)); + opened_by_user_gesture_)); SetPendingWindowRect(initial_pos_); } |