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 20 matching lines...) Expand all Loading... |
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" | 37 #include "grit/chromium_strings.h" |
38 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
39 #include "grit/theme_resources.h" | 39 #include "grit/theme_resources.h" |
40 #include "net/base/escape.h" | 40 #include "net/base/escape.h" |
41 #include "ui/base/l10n/l10n_util.h" | |
42 #include "ui/base/resource/resource_bundle.h" | 41 #include "ui/base/resource/resource_bundle.h" |
43 #include "ui/base/webui/web_ui_util.h" | 42 #include "ui/base/webui/web_ui_util.h" |
44 #include "ui/message_center/notifier_settings.h" | 43 #include "ui/message_center/notifier_settings.h" |
45 | 44 |
46 #if defined(ENABLE_EXTENSIONS) | 45 #if defined(ENABLE_EXTENSIONS) |
47 #include "chrome/browser/extensions/api/notifications/notifications_api.h" | 46 #include "chrome/browser/extensions/api/notifications/notifications_api.h" |
48 #include "chrome/browser/extensions/extension_service.h" | 47 #include "chrome/browser/extensions/extension_service.h" |
49 #include "extensions/browser/event_router.h" | 48 #include "extensions/browser/event_router.h" |
50 #include "extensions/browser/extension_registry.h" | 49 #include "extensions/browser/extension_registry.h" |
51 #include "extensions/browser/extension_system.h" | 50 #include "extensions/browser/extension_system.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 // Tell the IO thread that this extension's permission for notifications | 407 // Tell the IO thread that this extension's permission for notifications |
409 // has changed. | 408 // has changed. |
410 extensions::InfoMap* extension_info_map = | 409 extensions::InfoMap* extension_info_map = |
411 extensions::ExtensionSystem::Get(profile_)->info_map(); | 410 extensions::ExtensionSystem::Get(profile_)->info_map(); |
412 BrowserThread::PostTask( | 411 BrowserThread::PostTask( |
413 BrowserThread::IO, FROM_HERE, | 412 BrowserThread::IO, FROM_HERE, |
414 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, | 413 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, |
415 extension_info_map, notifier_id.id, !enabled)); | 414 extension_info_map, notifier_id.id, !enabled)); |
416 #endif | 415 #endif |
417 } | 416 } |
OLD | NEW |