OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/notifications/desktop_notification_service.h" | 5 #include "chrome/browser/notifications/desktop_notification_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/content_settings/content_settings_details.h" | 14 #include "chrome/browser/content_settings/content_settings_details.h" |
15 #include "chrome/browser/content_settings/content_settings_provider.h" | 15 #include "chrome/browser/content_settings/content_settings_provider.h" |
16 #include "chrome/browser/content_settings/host_content_settings_map.h" | 16 #include "chrome/browser/content_settings/host_content_settings_map.h" |
17 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | |
18 #include "chrome/browser/infobars/infobar_service.h" | 17 #include "chrome/browser/infobars/infobar_service.h" |
19 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 18 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
20 #include "chrome/browser/notifications/notification.h" | 19 #include "chrome/browser/notifications/notification.h" |
21 #include "chrome/browser/notifications/notification_object_proxy.h" | 20 #include "chrome/browser/notifications/notification_object_proxy.h" |
22 #include "chrome/browser/notifications/notification_ui_manager.h" | 21 #include "chrome/browser/notifications/notification_ui_manager.h" |
23 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" | 22 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" |
24 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac
tory.h" | 23 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac
tory.h" |
25 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
26 #include "chrome/browser/ui/browser.h" | 25 #include "chrome/browser/ui/browser.h" |
27 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 26 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
28 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" | 27 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" |
29 #include "chrome/common/content_settings.h" | 28 #include "chrome/common/content_settings.h" |
30 #include "chrome/common/content_settings_pattern.h" | 29 #include "chrome/common/content_settings_pattern.h" |
31 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
32 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
| 32 #include "components/infobars/core/confirm_infobar_delegate.h" |
33 #include "components/infobars/core/infobar.h" | 33 #include "components/infobars/core/infobar.h" |
34 #include "components/pref_registry/pref_registry_syncable.h" | 34 #include "components/pref_registry/pref_registry_syncable.h" |
35 #include "content/public/browser/browser_thread.h" | 35 #include "content/public/browser/browser_thread.h" |
36 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
37 #include "content/public/browser/render_frame_host.h" | 37 #include "content/public/browser/render_frame_host.h" |
38 #include "content/public/browser/render_process_host.h" | 38 #include "content/public/browser/render_process_host.h" |
39 #include "content/public/browser/render_view_host.h" | 39 #include "content/public/browser/render_view_host.h" |
40 #include "content/public/browser/web_contents.h" | 40 #include "content/public/browser/web_contents.h" |
41 #include "content/public/common/show_desktop_notification_params.h" | 41 #include "content/public/common/show_desktop_notification_params.h" |
42 #include "grit/browser_resources.h" | 42 #include "grit/browser_resources.h" |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 // Tell the IO thread that this extension's permission for notifications | 750 // Tell the IO thread that this extension's permission for notifications |
751 // has changed. | 751 // has changed. |
752 extensions::InfoMap* extension_info_map = | 752 extensions::InfoMap* extension_info_map = |
753 extensions::ExtensionSystem::Get(profile_)->info_map(); | 753 extensions::ExtensionSystem::Get(profile_)->info_map(); |
754 BrowserThread::PostTask( | 754 BrowserThread::PostTask( |
755 BrowserThread::IO, FROM_HERE, | 755 BrowserThread::IO, FROM_HERE, |
756 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, | 756 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, |
757 extension_info_map, notifier_id.id, !enabled)); | 757 extension_info_map, notifier_id.id, !enabled)); |
758 #endif | 758 #endif |
759 } | 759 } |
OLD | NEW |