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/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/notifications/desktop_notification_profile_util.h" | 13 #include "chrome/browser/notifications/desktop_notification_profile_util.h" |
14 #include "chrome/browser/notifications/notification.h" | 14 #include "chrome/browser/notifications/notification.h" |
15 #include "chrome/browser/notifications/notification_object_proxy.h" | 15 #include "chrome/browser/notifications/notification_object_proxy.h" |
16 #include "chrome/browser/notifications/notification_ui_manager.h" | 16 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 17 #include "chrome/browser/permissions/permission_request_id.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
20 #include "components/content_settings/core/common/permission_request_id.h" | |
21 #include "components/pref_registry/pref_registry_syncable.h" | 21 #include "components/pref_registry/pref_registry_syncable.h" |
22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
23 #include "ui/base/webui/web_ui_util.h" | 23 #include "ui/base/webui/web_ui_util.h" |
24 #include "ui/message_center/notifier_settings.h" | 24 #include "ui/message_center/notifier_settings.h" |
25 | 25 |
26 #if defined(ENABLE_EXTENSIONS) | 26 #if defined(ENABLE_EXTENSIONS) |
27 #include "chrome/browser/extensions/api/notifications/notifications_api.h" | 27 #include "chrome/browser/extensions/api/notifications/notifications_api.h" |
28 #include "chrome/browser/extensions/extension_service.h" | 28 #include "chrome/browser/extensions/extension_service.h" |
29 #include "extensions/browser/event_router.h" | 29 #include "extensions/browser/event_router.h" |
30 #include "extensions/browser/extension_registry.h" | 30 #include "extensions/browser/extension_registry.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // Tell the IO thread that this extension's permission for notifications | 276 // Tell the IO thread that this extension's permission for notifications |
277 // has changed. | 277 // has changed. |
278 extensions::InfoMap* extension_info_map = | 278 extensions::InfoMap* extension_info_map = |
279 extensions::ExtensionSystem::Get(profile_)->info_map(); | 279 extensions::ExtensionSystem::Get(profile_)->info_map(); |
280 BrowserThread::PostTask( | 280 BrowserThread::PostTask( |
281 BrowserThread::IO, FROM_HERE, | 281 BrowserThread::IO, FROM_HERE, |
282 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, | 282 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, |
283 extension_info_map, notifier_id.id, !enabled)); | 283 extension_info_map, notifier_id.id, !enabled)); |
284 #endif | 284 #endif |
285 } | 285 } |
OLD | NEW |