| 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 9ff4d4509b5eb5ed52cad2eb9e0c77cb30e2d140..691a28019685cf5e1c9e79bf6244c609a002933b 100644
|
| --- a/chrome/browser/notifications/desktop_notification_service.cc
|
| +++ b/chrome/browser/notifications/desktop_notification_service.cc
|
| @@ -58,7 +58,6 @@ using content::BrowserThread;
|
| using content::RenderViewHost;
|
| using content::WebContents;
|
| using message_center::NotifierId;
|
| -using WebKit::WebNotificationPresenter;
|
| using WebKit::WebTextDirection;
|
|
|
|
|
| @@ -650,27 +649,6 @@ void DesktopNotificationService::OnStringListPrefChanged(
|
| }
|
| }
|
|
|
| -WebKit::WebNotificationPresenter::Permission
|
| - DesktopNotificationService::HasPermission(const GURL& origin) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| - HostContentSettingsMap* host_content_settings_map =
|
| - profile_->GetHostContentSettingsMap();
|
| - ContentSetting setting = host_content_settings_map->GetContentSetting(
|
| - origin,
|
| - origin,
|
| - CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
|
| - NO_RESOURCE_IDENTIFIER);
|
| -
|
| - if (setting == CONTENT_SETTING_ALLOW)
|
| - return WebKit::WebNotificationPresenter::PermissionAllowed;
|
| - if (setting == CONTENT_SETTING_BLOCK)
|
| - return WebKit::WebNotificationPresenter::PermissionDenied;
|
| - if (setting == CONTENT_SETTING_ASK)
|
| - return WebKit::WebNotificationPresenter::PermissionNotAllowed;
|
| - NOTREACHED() << "Invalid notifications settings value: " << setting;
|
| - return WebKit::WebNotificationPresenter::PermissionNotAllowed;
|
| -}
|
| -
|
| void DesktopNotificationService::Observe(
|
| int type,
|
| const content::NotificationSource& source,
|
| @@ -700,4 +678,14 @@ void DesktopNotificationService::FirePermissionLevelChangedEvent(
|
| args.Pass()));
|
| extensions::ExtensionSystem::Get(profile_)->event_router()->
|
| DispatchEventToExtension(notifier_id.id, event.Pass());
|
| +
|
| + // Tell the IO thread that this extension's permission for notifications
|
| + // has changed.
|
| + ExtensionInfoMap* extension_info_map =
|
| + extensions::ExtensionSystem::Get(profile_)->info_map();
|
| + BrowserThread::PostTask(
|
| + BrowserThread::IO, FROM_HERE,
|
| + base::Bind(&ExtensionInfoMap::SetNotificationsDisabled,
|
| + extension_info_map, notifier_id.id, !enabled));
|
| +
|
| }
|
|
|