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

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

Issue 230453004: Remove InfoBarDelegate::web_contents() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android 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
Index: chrome/browser/infobars/insecure_content_infobar_delegate.cc
diff --git a/chrome/browser/infobars/insecure_content_infobar_delegate.cc b/chrome/browser/infobars/insecure_content_infobar_delegate.cc
index 90d1cb7f31327443a0704f9d7e72cb86fe1c0949..fbdcfc453cb9d4030bf64259ff3beffad89dfcf0 100644
--- a/chrome/browser/infobars/insecure_content_infobar_delegate.cc
+++ b/chrome/browser/infobars/insecure_content_infobar_delegate.cc
@@ -91,13 +91,15 @@ bool InsecureContentInfoBarDelegate::Cancel() {
(type_ == DISPLAY) ? DISPLAY_USER_OVERRIDE : RUN_USER_OVERRIDE,
NUM_EVENTS);
- web_contents()->SendToAllFrames((type_ == DISPLAY) ?
+ content::WebContents* web_contents =
+ InfoBarService::WebContentsFromInfoBar(infobar());
+ web_contents->SendToAllFrames((type_ == DISPLAY) ?
static_cast<IPC::Message*>(
new ChromeViewMsg_SetAllowDisplayingInsecureContent(MSG_ROUTING_NONE,
true)) :
new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true));
- web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame(
- web_contents()->GetMainFrame()->GetRoutingID()));
+ web_contents->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame(
+ web_contents->GetMainFrame()->GetRoutingID()));
return true;
}
@@ -107,8 +109,11 @@ base::string16 InsecureContentInfoBarDelegate::GetLinkText() const {
bool InsecureContentInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- web_contents()->OpenURL(content::OpenURLParams(
- google_util::AppendGoogleLocaleParam(GURL("https://www.google.com/"
+ content::WebContents* web_contents =
+ InfoBarService::WebContentsFromInfoBar(infobar());
+ web_contents->OpenURL(content::OpenURLParams(
+ google_util::AppendGoogleLocaleParam(GURL(
+ "https://www.google.com/"
"support/chrome/bin/answer.py?answer=1342714")),
content::Referrer(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,

Powered by Google App Engine
This is Rietveld 408576698