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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "components/pref_registry/pref_registry_syncable.h" | 27 #include "components/pref_registry/pref_registry_syncable.h" |
28 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
29 #include "content/public/browser/desktop_notification_delegate.h" | 29 #include "content/public/browser/desktop_notification_delegate.h" |
30 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
31 #include "content/public/browser/render_frame_host.h" | 31 #include "content/public/browser/render_frame_host.h" |
32 #include "content/public/browser/render_process_host.h" | 32 #include "content/public/browser/render_process_host.h" |
33 #include "content/public/browser/render_view_host.h" | 33 #include "content/public/browser/render_view_host.h" |
34 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
35 #include "content/public/common/show_desktop_notification_params.h" | 35 #include "content/public/common/show_desktop_notification_params.h" |
36 #include "grit/browser_resources.h" | 36 #include "grit/browser_resources.h" |
37 #include "grit/chromium_strings.h" | |
38 #include "grit/generated_resources.h" | |
39 #include "grit/theme_resources.h" | 37 #include "grit/theme_resources.h" |
40 #include "net/base/escape.h" | 38 #include "net/base/escape.h" |
41 #include "ui/base/resource/resource_bundle.h" | 39 #include "ui/base/resource/resource_bundle.h" |
42 #include "ui/base/webui/web_ui_util.h" | 40 #include "ui/base/webui/web_ui_util.h" |
43 #include "ui/message_center/notifier_settings.h" | 41 #include "ui/message_center/notifier_settings.h" |
44 | 42 |
45 #if defined(ENABLE_EXTENSIONS) | 43 #if defined(ENABLE_EXTENSIONS) |
46 #include "chrome/browser/extensions/api/notifications/notifications_api.h" | 44 #include "chrome/browser/extensions/api/notifications/notifications_api.h" |
47 #include "chrome/browser/extensions/extension_service.h" | 45 #include "chrome/browser/extensions/extension_service.h" |
48 #include "extensions/browser/event_router.h" | 46 #include "extensions/browser/event_router.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 // Tell the IO thread that this extension's permission for notifications | 405 // Tell the IO thread that this extension's permission for notifications |
408 // has changed. | 406 // has changed. |
409 extensions::InfoMap* extension_info_map = | 407 extensions::InfoMap* extension_info_map = |
410 extensions::ExtensionSystem::Get(profile_)->info_map(); | 408 extensions::ExtensionSystem::Get(profile_)->info_map(); |
411 BrowserThread::PostTask( | 409 BrowserThread::PostTask( |
412 BrowserThread::IO, FROM_HERE, | 410 BrowserThread::IO, FROM_HERE, |
413 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, | 411 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, |
414 extension_info_map, notifier_id.id, !enabled)); | 412 extension_info_map, notifier_id.id, !enabled)); |
415 #endif | 413 #endif |
416 } | 414 } |
OLD | NEW |