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

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 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
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..1d0a3369679a48a7d92fd553fc9e97ccc5af2f9a 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,11 +109,13 @@ base::string16 InsecureContentInfoBarDelegate::GetLinkText() const {
bool InsecureContentInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- 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,
- content::PAGE_TRANSITION_LINK, false));
+ InfoBarService::WebContentsFromInfoBar(infobar())->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,
+ content::PAGE_TRANSITION_LINK, false));
return false;
}
« no previous file with comments | « chrome/browser/infobars/infobar_delegate.cc ('k') | chrome/browser/managed_mode/managed_mode_navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698