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

Unified Diff: chrome/browser/plugins/plugin_infobar_delegates.cc

Issue 230453004: Remove InfoBarDelegate::web_contents() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile Created 6 years, 8 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
« no previous file with comments | « chrome/browser/pepper_broker_infobar_delegate.cc ('k') | chrome/browser/ssl/ssl_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6530594b5241ec55bc25adab8779975837c71b8a..846c319e3502555e4a8b03dc97bd4995d94a0947 100644
--- a/chrome/browser/plugins/plugin_infobar_delegates.cc
+++ b/chrome/browser/plugins/plugin_infobar_delegates.cc
@@ -57,16 +57,19 @@ PluginInfoBarDelegate::~PluginInfoBarDelegate() {
}
bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
- web_contents()->OpenURL(content::OpenURLParams(
- GURL(GetLearnMoreURL()), content::Referrer(),
- (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK, false));
+ InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL(
+ content::OpenURLParams(
+ GURL(GetLearnMoreURL()), content::Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ content::PAGE_TRANSITION_LINK, false));
return false;
}
void PluginInfoBarDelegate::LoadBlockedPlugins() {
+ content::WebContents* web_contents =
+ InfoBarService::WebContentsFromInfoBar(infobar());
ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins(
- web_contents(), true, identifier_);
+ web_contents, true, identifier_);
}
int PluginInfoBarDelegate::GetIconID() const {
@@ -145,7 +148,7 @@ bool UnauthorizedPluginInfoBarDelegate::Accept() {
bool UnauthorizedPluginInfoBarDelegate::Cancel() {
content::RecordAction(UserMetricsAction("BlockedPluginInfobar.AlwaysAllow"));
- const GURL& url = web_contents()->GetURL();
+ const GURL& url = InfoBarService::WebContentsFromInfoBar(infobar())->GetURL();
content_settings_->AddExceptionForURL(url, url, CONTENT_SETTINGS_TYPE_PLUGINS,
CONTENT_SETTING_ALLOW);
LoadBlockedPlugins();
@@ -238,10 +241,12 @@ bool OutdatedPluginInfoBarDelegate::Accept() {
// result in deleting ourselves. Accordingly, we make sure to
// not pass a reference to an object that can go away.
GURL plugin_url(plugin_metadata_->plugin_url());
+ content::WebContents* web_contents =
+ InfoBarService::WebContentsFromInfoBar(infobar());
if (plugin_metadata_->url_for_display())
- installer()->OpenDownloadURL(plugin_url, web_contents());
+ installer()->OpenDownloadURL(plugin_url, web_contents);
else
- installer()->StartInstalling(plugin_url, web_contents());
+ installer()->StartInstalling(plugin_url, web_contents);
return false;
}
@@ -392,10 +397,11 @@ bool PluginInstallerInfoBarDelegate::LinkClicked(
url = google_util::AppendGoogleLocaleParam(GURL(
"https://www.google.com/support/chrome/bin/answer.py?answer=142064"));
}
- web_contents()->OpenURL(content::OpenURLParams(
- url, content::Referrer(),
- (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK, false));
+ InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL(
+ content::OpenURLParams(
+ url, content::Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ content::PAGE_TRANSITION_LINK, false));
return false;
}
@@ -515,13 +521,14 @@ bool PluginMetroModeInfoBarDelegate::LinkClicked(
// TODO(shrikant): We may need to change language a little at following
// support URLs. With new approach we will just restart for both missing
// and not missing mode.
- web_contents()->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"),
- content::Referrer(),
- (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK, false));
+ 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"),
+ content::Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ content::PAGE_TRANSITION_LINK, false));
return false;
}
« no previous file with comments | « chrome/browser/pepper_broker_infobar_delegate.cc ('k') | chrome/browser/ssl/ssl_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698