Chromium Code Reviews| Index: chrome/browser/notifications/desktop_notification_service.cc |
| diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc |
| index fad44eb4d08637db2d682900097157e443a90a9d..db09c2df39868039632790578f3d0686cff948e7 100644 |
| --- a/chrome/browser/notifications/desktop_notification_service.cc |
| +++ b/chrome/browser/notifications/desktop_notification_service.cc |
| @@ -142,7 +142,7 @@ void DesktopNotificationService::RequestNotificationPermission( |
| const PermissionRequestID& request_id, |
| const GURL& requesting_origin, |
| bool user_gesture, |
| - const NotificationPermissionCallback& callback) { |
| + const base::Callback<void(bool)>& result_callback) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| #if defined(ENABLE_EXTENSIONS) |
| @@ -169,19 +169,16 @@ void DesktopNotificationService::RequestNotificationPermission( |
| extensions::APIPermission::kNotifications, |
| extension, |
| web_contents->GetRenderViewHost())) { |
| - callback.Run(blink::WebNotificationPermissionAllowed); |
| + result_callback.Run(true); |
| return; |
| } |
| #endif |
| - RequestPermission( |
| - web_contents, |
| - request_id, |
| - requesting_origin, |
| - user_gesture, |
| - base::Bind(&DesktopNotificationService::OnNotificationPermissionRequested, |
| - weak_factory_.GetWeakPtr(), |
| - callback)); |
| + RequestPermission(web_contents, |
| + request_id, |
| + requesting_origin, |
| + user_gesture, |
| + result_callback); |
|
Peter Beverloo
2014/10/24 14:37:28
Please remove the WeakPtrFactory from the DesktopN
Miguel Garcia
2014/10/24 16:05:32
Done.
|
| } |
| void DesktopNotificationService::ShowDesktopNotification( |
| @@ -357,15 +354,6 @@ void DesktopNotificationService::UpdateContentSetting( |
| } |
| } |
| -void DesktopNotificationService::OnNotificationPermissionRequested( |
| - const NotificationPermissionCallback& callback, bool allowed) { |
| - blink::WebNotificationPermission permission = allowed ? |
| - blink::WebNotificationPermissionAllowed : |
| - blink::WebNotificationPermissionDenied; |
| - |
| - callback.Run(permission); |
| -} |
| - |
| void DesktopNotificationService::FirePermissionLevelChangedEvent( |
| const NotifierId& notifier_id, bool enabled) { |
| #if defined(ENABLE_EXTENSIONS) |