diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-23 20:31:02 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-23 20:31:02 +0000 |
commit | 08bdf169df239148d30ff4c22dd6095b93b73834 (patch) | |
tree | c7e3535760593e451ad92bcc9c73096ddba43ffb | |
parent | dcb68db8f7287946e7741250680d2b4cada75179 (diff) | |
download | chromium_src-08bdf169df239148d30ff4c22dd6095b93b73834.zip chromium_src-08bdf169df239148d30ff4c22dd6095b93b73834.tar.gz chromium_src-08bdf169df239148d30ff4c22dd6095b93b73834.tar.bz2 |
Fix links from HTML notifications not opening new tabs. This mirrors the fix for BackgroundContents in http://src.chromium.org/viewvc/chrome?view=rev&revision=113955
BUG=111014
Review URL: https://chromiumcodereview.appspot.com/9200015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118727 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/notifications/balloon_host.cc | 13 | ||||
-rw-r--r-- | chrome/browser/notifications/balloon_host.h | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index 1846316..e5590f9 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -7,6 +7,7 @@ #include "chrome/browser/notifications/notification.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_preferences_util.h" +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" #include "chrome/common/chrome_notification_types.h" @@ -71,6 +72,18 @@ void BalloonHost::UpdatePreferredSize(WebContents* source, balloon_->SetContentPreferredSize(pref_size); } +void BalloonHost::AddNewContents(WebContents* source, + WebContents* new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_pos, + bool user_gesture) { + Browser* browser = BrowserList::GetLastActiveWithProfile( + Profile::FromBrowserContext(new_contents->GetBrowserContext())); + if (!browser) + return; + browser->AddWebContents(new_contents, disposition, initial_pos, user_gesture); +} + void BalloonHost::RenderViewCreated(RenderViewHost* render_view_host) { render_view_host->DisableScrollbarsForThreshold( balloon_->min_scrollbar_size()); diff --git a/chrome/browser/notifications/balloon_host.h b/chrome/browser/notifications/balloon_host.h index 335c1f5..710961a5 100644 --- a/chrome/browser/notifications/balloon_host.h +++ b/chrome/browser/notifications/balloon_host.h @@ -58,6 +58,11 @@ class BalloonHost : public content::WebContentsDelegate, virtual void HandleMouseDown() OVERRIDE; virtual void UpdatePreferredSize(content::WebContents* source, const gfx::Size& pref_size) OVERRIDE; + virtual void AddNewContents(content::WebContents* source, + content::WebContents* new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_pos, + bool user_gesture) OVERRIDE; // content::WebContentsObserver implementation: virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |