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

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

Issue 10830353: Introduce InfoBarTabService API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments, merge to LKGR Created 8 years, 4 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 1734103b1131f0ece97b1ed4748033dabbc4e3b3..34ac0d46229202e09238b2c9eb0dce9159ecd7fc 100644
--- a/chrome/browser/infobars/insecure_content_infobar_delegate.cc
+++ b/chrome/browser/infobars/insecure_content_infobar_delegate.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/common/render_messages.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/page_transition_types.h"
#include "grit/generated_resources.h"
@@ -67,10 +68,16 @@ bool InsecureContentInfoBarDelegate::Cancel() {
(type_ == DISPLAY) ? DISPLAY_USER_OVERRIDE : RUN_USER_OVERRIDE,
NUM_EVENTS);
- int32 routing_id = owner()->routing_id();
- owner()->Send((type_ == DISPLAY) ? static_cast<IPC::Message*>(
- new ChromeViewMsg_SetAllowDisplayingInsecureContent(routing_id, true)) :
- new ChromeViewMsg_SetAllowRunningInsecureContent(routing_id, true));
+ content::WebContents* web_contents = owner()->GetWebContents();
+ if (web_contents) {
+ int32 routing_id = web_contents->GetRoutingID();
+ web_contents->Send((type_ == DISPLAY) ?
+ static_cast<IPC::Message*>(
+ new ChromeViewMsg_SetAllowDisplayingInsecureContent(
+ routing_id, true)) :
+ new ChromeViewMsg_SetAllowRunningInsecureContent(
+ routing_id, true));
+ }
return true;
}
@@ -80,7 +87,7 @@ string16 InsecureContentInfoBarDelegate::GetLinkText() const {
bool InsecureContentInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- owner()->web_contents()->OpenURL(OpenURLParams(
+ owner()->GetWebContents()->OpenURL(OpenURLParams(
google_util::AppendGoogleLocaleParam(GURL(
"https://www.google.com/support/chrome/bin/answer.py?answer=1342714")),
content::Referrer(),
« no previous file with comments | « chrome/browser/infobars/insecure_content_infobar_delegate.h ('k') | chrome/browser/notifications/notification_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698