Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1853)

Unified Diff: chrome/browser/infobars/infobar_service.cc

Issue 1361253002: Separate the URL of an infobar link with clicking on it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pkasting Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/infobars/infobar_service.cc
diff --git a/chrome/browser/infobars/infobar_service.cc b/chrome/browser/infobars/infobar_service.cc
index fdfd9a6339e58d4abcab52061f67e3739d727d26..77f9937ce2ed08e862781905d1e7515ed195f240 100644
--- a/chrome/browser/infobars/infobar_service.cc
+++ b/chrome/browser/infobars/infobar_service.cc
@@ -129,3 +129,14 @@ bool InfoBarService::OnMessageReceived(const IPC::Message& message) {
void InfoBarService::OnDidBlockDisplayingInsecureContent() {
InsecureContentInfoBarDelegate::Create(this);
}
+
+void InfoBarService::OpenURL(const GURL& url,
+ WindowOpenDisposition disposition) {
+ // A normal user click on an infobar URL will result in a CURRENT_TAB
+ // disposition; turn that into a NEW_FOREGROUND_TAB so that we don't end up
+ // smashing the page the user is looking at.
+ web_contents()->OpenURL(content::OpenURLParams(
+ url, content::Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ ui::PAGE_TRANSITION_LINK, false));
+}
« no previous file with comments | « chrome/browser/infobars/infobar_service.h ('k') | chrome/browser/infobars/insecure_content_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698