| Index: content/browser/frame_host/render_frame_host_impl.cc | 
| diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc | 
| index 1f228805e7651e4c4876b0ca92393e503dc9ec18..16119f985dc021447228a0e00f4d3452ce2a922d 100644 | 
| --- a/content/browser/frame_host/render_frame_host_impl.cc | 
| +++ b/content/browser/frame_host/render_frame_host_impl.cc | 
| @@ -1011,14 +1011,22 @@ void RenderFrameHostImpl::OnRunBeforeUnloadConfirm( | 
|  | 
| void RenderFrameHostImpl::OnRequestPlatformNotificationPermission( | 
| const GURL& origin, int request_id) { | 
| -  base::Callback<void(blink::WebNotificationPermission)> done_callback = | 
| -      base::Bind( | 
| -          &RenderFrameHostImpl::PlatformNotificationPermissionRequestDone, | 
| -          weak_ptr_factory_.GetWeakPtr(), | 
| -          request_id); | 
| +  base::Callback<void(bool)> done_callback = base::Bind( | 
| +      &RenderFrameHostImpl::PlatformNotificationPermissionRequestDone, | 
| +      weak_ptr_factory_.GetWeakPtr(), | 
| +      request_id); | 
| + | 
| +  if (!delegate()->GetAsWebContents()) | 
| +    return; | 
|  | 
| -  GetContentClient()->browser()->RequestDesktopNotificationPermission( | 
| -      origin, this, done_callback); | 
| +  // TODO(peter): plumb user_gesture and bridge_id. | 
| +  GetContentClient()->browser()->RequestPermission( | 
| +      content::PERMISSION_NOTIFICATIONS, | 
| +      delegate()->GetAsWebContents(), | 
| +      routing_id_, | 
| +      origin, | 
| +      true,  // user_gesture, | 
| +      done_callback); | 
| } | 
|  | 
| void RenderFrameHostImpl::OnShowDesktopNotification( | 
| @@ -1443,7 +1451,12 @@ void RenderFrameHostImpl::CommitNavigation( | 
| } | 
|  | 
| void RenderFrameHostImpl::PlatformNotificationPermissionRequestDone( | 
| -    int request_id, blink::WebNotificationPermission permission) { | 
| +    int request_id, | 
| +    bool granted) { | 
| +  blink::WebNotificationPermission permission = | 
| +      granted ? blink::WebNotificationPermissionAllowed | 
| +              : blink::WebNotificationPermissionDenied; | 
| + | 
| Send(new PlatformNotificationMsg_PermissionRequestComplete( | 
| routing_id_, request_id, permission)); | 
| } | 
|  |