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

Unified Diff: chrome/browser/plugins/plugin_infobar_delegates.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: fit 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/plugins/plugin_infobar_delegates.cc
diff --git a/chrome/browser/plugins/plugin_infobar_delegates.cc b/chrome/browser/plugins/plugin_infobar_delegates.cc
index 01739b4ecefc486338c806761237aab6ec138b47..0594234d3858aa375dd6c5e3b7b3c003fe5e6d84 100644
--- a/chrome/browser/plugins/plugin_infobar_delegates.cc
+++ b/chrome/browser/plugins/plugin_infobar_delegates.cc
@@ -60,7 +60,7 @@ PluginInfoBarDelegate::~PluginInfoBarDelegate() {
bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL(
content::OpenURLParams(
- GURL(GetLearnMoreURL()), content::Referrer(),
+ GetLinkURL(), content::Referrer(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
ui::PAGE_TRANSITION_LINK, false));
return false;
@@ -81,6 +81,10 @@ base::string16 PluginInfoBarDelegate::GetLinkText() const {
return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
}
+GURL PluginInfoBarDelegate::GetLinkURL() const {
+ return GURL(GetLearnMoreURL());
Peter Kasting 2015/09/24 21:18:27 We should just eliminate GetLearnMoreURL() and eit
+}
+
#if defined(ENABLE_PLUGIN_INSTALLATION)
// OutdatedPluginInfoBarDelegate ----------------------------------------------
@@ -297,6 +301,12 @@ base::string16 PluginMetroModeInfoBarDelegate::GetLinkText() const {
return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
}
+GURL PluginMetroModeInfoBarDelegate::GetLinkURL() const {
+ return GURL((mode_ == MISSING_PLUGIN) ?
+ "https://support.google.com/chrome/?p=ib_display_in_desktop" :
+ "https://support.google.com/chrome/?p=ib_redirect_to_desktop");
+}
+
bool PluginMetroModeInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
// TODO(shrikant): We may need to change language a little at following
@@ -304,9 +314,7 @@ bool PluginMetroModeInfoBarDelegate::LinkClicked(
// and not missing mode.
InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL(
content::OpenURLParams(
- GURL((mode_ == MISSING_PLUGIN) ?
- "https://support.google.com/chrome/?p=ib_display_in_desktop" :
- "https://support.google.com/chrome/?p=ib_redirect_to_desktop"),
+ GetLinkURL(),
content::Referrer(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
ui::PAGE_TRANSITION_LINK, false));

Powered by Google App Engine
This is Rietveld 408576698