Commit a6e397c7 authored by miguelg@chromium.org's avatar miguelg@chromium.org

[InfoBar] remove unnecesary checks from some delegates.

BUG=none

Review URL: https://codereview.chromium.org/56123010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233383 0039d316-1c4b-4281-b951-d872f2087c98
parent 05ae3cb5
......@@ -106,11 +106,10 @@ bool GeolocationInfoBarDelegate::Accept() {
void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting,
bool allowed) {
if (web_contents()) {
GURL embedder = web_contents()->GetLastCommittedURL().GetOrigin();
controller_->OnPermissionSet(id_, requesting_frame_, embedder,
update_content_setting, allowed);
}
controller_->OnPermissionSet(
id_, requesting_frame_,
web_contents()->GetLastCommittedURL().GetOrigin(),
update_content_setting, allowed);
}
void GeolocationInfoBarDelegate::InfoBarDismissed() {
......
......@@ -82,7 +82,6 @@ bool InsecureContentInfoBarDelegate::Accept() {
return true;
}
// Cancel button is labelled "load anyways". It triggers Cancel(), but really
// means become insecure, so do the work of reloading the page.
bool InsecureContentInfoBarDelegate::Cancel() {
......@@ -90,14 +89,12 @@ bool InsecureContentInfoBarDelegate::Cancel() {
(type_ == DISPLAY) ? DISPLAY_USER_OVERRIDE : RUN_USER_OVERRIDE,
NUM_EVENTS);
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));
}
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment