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() { ...@@ -106,11 +106,10 @@ bool GeolocationInfoBarDelegate::Accept() {
void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting, void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting,
bool allowed) { bool allowed) {
if (web_contents()) { controller_->OnPermissionSet(
GURL embedder = web_contents()->GetLastCommittedURL().GetOrigin(); id_, requesting_frame_,
controller_->OnPermissionSet(id_, requesting_frame_, embedder, web_contents()->GetLastCommittedURL().GetOrigin(),
update_content_setting, allowed); update_content_setting, allowed);
}
} }
void GeolocationInfoBarDelegate::InfoBarDismissed() { void GeolocationInfoBarDelegate::InfoBarDismissed() {
......
...@@ -82,7 +82,6 @@ bool InsecureContentInfoBarDelegate::Accept() { ...@@ -82,7 +82,6 @@ bool InsecureContentInfoBarDelegate::Accept() {
return true; return true;
} }
// Cancel button is labelled "load anyways". It triggers Cancel(), but really // Cancel button is labelled "load anyways". It triggers Cancel(), but really
// means become insecure, so do the work of reloading the page. // means become insecure, so do the work of reloading the page.
bool InsecureContentInfoBarDelegate::Cancel() { bool InsecureContentInfoBarDelegate::Cancel() {
...@@ -90,14 +89,12 @@ bool InsecureContentInfoBarDelegate::Cancel() { ...@@ -90,14 +89,12 @@ bool InsecureContentInfoBarDelegate::Cancel() {
(type_ == DISPLAY) ? DISPLAY_USER_OVERRIDE : RUN_USER_OVERRIDE, (type_ == DISPLAY) ? DISPLAY_USER_OVERRIDE : RUN_USER_OVERRIDE,
NUM_EVENTS); NUM_EVENTS);
if (web_contents()) { int32 routing_id = web_contents()->GetRoutingID();
int32 routing_id = web_contents()->GetRoutingID(); web_contents()->Send((type_ == DISPLAY) ?
web_contents()->Send((type_ == DISPLAY) ? static_cast<IPC::Message*>(
static_cast<IPC::Message*>( new ChromeViewMsg_SetAllowDisplayingInsecureContent(routing_id,
new ChromeViewMsg_SetAllowDisplayingInsecureContent(routing_id, true)) :
true)) : new ChromeViewMsg_SetAllowRunningInsecureContent(routing_id, true));
new ChromeViewMsg_SetAllowRunningInsecureContent(routing_id, true));
}
return 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