Commit adb5ab5d authored by pkasting@chromium.org's avatar pkasting@chromium.org

Be more consistent about respecting link click dispositions in infobars: for...

Be more consistent about respecting link click dispositions in infobars: for most infobars, we should open with the desired disposition, unless it would overwrite the current window, in which case we use a new foreground tab.

BUG=none
TEST=none
Review URL: https://codereview.chromium.org/11778029

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194480 0039d316-1c4b-4281-b951-d872f2087c98
parent eefbe99e
......@@ -110,11 +110,12 @@ string16 AutofillCCInfoBarDelegate::GetLinkText() const {
bool AutofillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
owner()->GetWebContents()->GetDelegate()->OpenURLFromTab(
owner()->GetWebContents(),
content::OpenURLParams(GURL(autofill::kHelpURL),
content::Referrer(),
NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK,
false));
content::OpenURLParams(
GURL(autofill::kHelpURL),
content::Referrer(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
content::PAGE_TRANSITION_LINK,
false));
return false;
}
......
......@@ -546,7 +546,8 @@ bool OneClickInfoBarDelegateImpl::LinkClicked(
WindowOpenDisposition disposition) {
RecordHistogramAction(one_click_signin::HISTOGRAM_LEARN_MORE);
content::OpenURLParams params(
GURL(chrome::kChromeSyncLearnMoreURL), content::Referrer(), disposition,
GURL(chrome::kChromeSyncLearnMoreURL), content::Referrer(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
content::PAGE_TRANSITION_LINK, false);
owner()->GetWebContents()->OpenURL(params);
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment