summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-23 21:14:47 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-23 21:14:47 +0000
commitf5bbc4ab2e6b058f80ca7a5bda98b90ba7d7d0cd (patch)
tree956cf2b4967783a773ed7c4ec35d6c41ebc2483d /chrome/browser/notifications
parent9eff5038e4a4958ff341354df447aca04d5aceb3 (diff)
downloadchromium_src-f5bbc4ab2e6b058f80ca7a5bda98b90ba7d7d0cd.zip
chromium_src-f5bbc4ab2e6b058f80ca7a5bda98b90ba7d7d0cd.tar.gz
chromium_src-f5bbc4ab2e6b058f80ca7a5bda98b90ba7d7d0cd.tar.bz2
Merge 118727 (not quite a straight merge because of refactorings in the meantime, I've updated from WebContents to TabContents)- 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 TBR=jam@chromium.org Review URL: https://chromiumcodereview.appspot.com/9226044 git-svn-id: svn://svn.chromium.org/chrome/branches/963/src@118737 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications')
-rw-r--r--chrome/browser/notifications/balloon_host.cc13
-rw-r--r--chrome/browser/notifications/balloon_host.h5
2 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc
index d0ba053..b7d52b2 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"
@@ -73,6 +74,18 @@ void BalloonHost::UpdatePreferredSize(TabContents* source,
balloon_->SetContentPreferredSize(pref_size);
}
+void BalloonHost::AddNewContents(TabContents* source,
+ TabContents* new_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture) {
+ Browser* browser = BrowserList::GetLastActiveWithProfile(
+ Profile::FromBrowserContext(new_contents->browser_context()));
+ if (!browser)
+ return;
+ browser->AddTabContents(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 bc52624..0a629a3 100644
--- a/chrome/browser/notifications/balloon_host.h
+++ b/chrome/browser/notifications/balloon_host.h
@@ -63,6 +63,11 @@ class BalloonHost : public TabContentsDelegate,
virtual void HandleMouseDown() OVERRIDE;
virtual void UpdatePreferredSize(TabContents* source,
const gfx::Size& pref_size) OVERRIDE;
+ virtual void AddNewContents(TabContents* source,
+ TabContents* new_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture) OVERRIDE;
// TabContentsObserver implementation:
virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;