| 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 995c7ddac192fa03b2d2ec62ab245f1c24d4a086..3a7a3c1392434abc65e47bb2117dbc793b88bc09 100644
|
| --- a/chrome/browser/notifications/desktop_notification_service.cc
|
| +++ b/chrome/browser/notifications/desktop_notification_service.cc
|
| @@ -13,8 +13,6 @@
|
| #include "chrome/browser/content_settings/content_settings_details.h"
|
| #include "chrome/browser/content_settings/content_settings_provider.h"
|
| #include "chrome/browser/content_settings/host_content_settings_map.h"
|
| -#include "chrome/browser/extensions/api/notifications/notifications_api.h"
|
| -#include "chrome/browser/extensions/extension_service.h"
|
| #include "chrome/browser/infobars/confirm_infobar_delegate.h"
|
| #include "chrome/browser/infobars/infobar_service.h"
|
| #include "chrome/browser/notifications/desktop_notification_service_factory.h"
|
| @@ -38,12 +36,6 @@
|
| #include "content/public/browser/render_view_host.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/common/show_desktop_notification_params.h"
|
| -#include "extensions/browser/event_router.h"
|
| -#include "extensions/browser/extension_system.h"
|
| -#include "extensions/browser/info_map.h"
|
| -#include "extensions/common/constants.h"
|
| -#include "extensions/common/extension.h"
|
| -#include "extensions/common/extension_set.h"
|
| #include "grit/browser_resources.h"
|
| #include "grit/chromium_strings.h"
|
| #include "grit/generated_resources.h"
|
| @@ -55,6 +47,17 @@
|
| #include "ui/message_center/message_center_util.h"
|
| #include "ui/message_center/notifier_settings.h"
|
|
|
| +#if defined(ENABLE_EXTENSIONS)
|
| +#include "chrome/browser/extensions/api/notifications/notifications_api.h"
|
| +#include "chrome/browser/extensions/extension_service.h"
|
| +#include "extensions/browser/event_router.h"
|
| +#include "extensions/browser/extension_system.h"
|
| +#include "extensions/browser/info_map.h"
|
| +#include "extensions/common/constants.h"
|
| +#include "extensions/common/extension.h"
|
| +#include "extensions/common/extension_set.h"
|
| +#endif
|
| +
|
| using content::BrowserThread;
|
| using content::RenderViewHost;
|
| using content::WebContents;
|
| @@ -588,6 +591,7 @@ bool DesktopNotificationService::ShowDesktopNotification(
|
|
|
| base::string16 DesktopNotificationService::DisplayNameForOriginInProcessId(
|
| const GURL& origin, int process_id) {
|
| +#if defined(ENABLE_EXTENSIONS)
|
| // If the source is an extension, lookup the display name.
|
| if (origin.SchemeIs(extensions::kExtensionScheme)) {
|
| extensions::InfoMap* extension_info_map =
|
| @@ -605,6 +609,8 @@ base::string16 DesktopNotificationService::DisplayNameForOriginInProcessId(
|
| }
|
| }
|
| }
|
| +#endif
|
| +
|
| return base::UTF8ToUTF16(origin.host());
|
| }
|
|
|
| @@ -728,6 +734,7 @@ void DesktopNotificationService::Observe(
|
| int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
| +#if defined(ENABLE_EXTENSIONS)
|
| DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_UNINSTALLED, type);
|
|
|
| extensions::Extension* extension =
|
| @@ -741,10 +748,12 @@ void DesktopNotificationService::Observe(
|
| return;
|
|
|
| SetNotifierEnabled(notifier_id, true);
|
| +#endif
|
| }
|
|
|
| void DesktopNotificationService::FirePermissionLevelChangedEvent(
|
| const NotifierId& notifier_id, bool enabled) {
|
| +#if defined(ENABLE_EXTENSIONS)
|
| DCHECK_EQ(NotifierId::APPLICATION, notifier_id.type);
|
| extensions::api::notifications::PermissionLevel permission =
|
| enabled ? extensions::api::notifications::PERMISSION_LEVEL_GRANTED
|
| @@ -766,5 +775,5 @@ void DesktopNotificationService::FirePermissionLevelChangedEvent(
|
| BrowserThread::IO, FROM_HERE,
|
| base::Bind(&extensions::InfoMap::SetNotificationsDisabled,
|
| extension_info_map, notifier_id.id, !enabled));
|
| -
|
| +#endif
|
| }
|
|
|