Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: chrome/browser/notifications/desktop_notification_service.cc

Issue 240193003: Move Infobars core files to the Infobars component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nib name on mac Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/prefs/scoped_user_pref_update.h" 8 #include "base/prefs/scoped_user_pref_update.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
13 #include "chrome/browser/content_settings/content_settings_details.h" 13 #include "chrome/browser/content_settings/content_settings_details.h"
14 #include "chrome/browser/content_settings/content_settings_provider.h" 14 #include "chrome/browser/content_settings/content_settings_provider.h"
15 #include "chrome/browser/content_settings/host_content_settings_map.h" 15 #include "chrome/browser/content_settings/host_content_settings_map.h"
16 #include "chrome/browser/extensions/api/notifications/notifications_api.h" 16 #include "chrome/browser/extensions/api/notifications/notifications_api.h"
17 #include "chrome/browser/extensions/extension_service.h" 17 #include "chrome/browser/extensions/extension_service.h"
18 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 18 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
19 #include "chrome/browser/infobars/infobar.h"
20 #include "chrome/browser/infobars/infobar_service.h" 19 #include "chrome/browser/infobars/infobar_service.h"
21 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 20 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
22 #include "chrome/browser/notifications/notification.h" 21 #include "chrome/browser/notifications/notification.h"
23 #include "chrome/browser/notifications/notification_object_proxy.h" 22 #include "chrome/browser/notifications/notification_object_proxy.h"
24 #include "chrome/browser/notifications/notification_ui_manager.h" 23 #include "chrome/browser/notifications/notification_ui_manager.h"
25 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" 24 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h"
26 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac tory.h" 25 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac tory.h"
27 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/ui/browser.h" 27 #include "chrome/browser/ui/browser.h"
29 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" 28 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
30 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" 29 #include "chrome/browser/ui/website_settings/permission_bubble_request.h"
31 #include "chrome/common/content_settings.h" 30 #include "chrome/common/content_settings.h"
32 #include "chrome/common/content_settings_pattern.h" 31 #include "chrome/common/content_settings_pattern.h"
33 #include "chrome/common/pref_names.h" 32 #include "chrome/common/pref_names.h"
34 #include "chrome/common/url_constants.h" 33 #include "chrome/common/url_constants.h"
34 #include "components/infobars/core/infobar.h"
35 #include "components/user_prefs/pref_registry_syncable.h" 35 #include "components/user_prefs/pref_registry_syncable.h"
36 #include "content/public/browser/browser_thread.h" 36 #include "content/public/browser/browser_thread.h"
37 #include "content/public/browser/notification_service.h" 37 #include "content/public/browser/notification_service.h"
38 #include "content/public/browser/render_view_host.h" 38 #include "content/public/browser/render_view_host.h"
39 #include "content/public/browser/web_contents.h" 39 #include "content/public/browser/web_contents.h"
40 #include "content/public/common/show_desktop_notification_params.h" 40 #include "content/public/common/show_desktop_notification_params.h"
41 #include "extensions/browser/event_router.h" 41 #include "extensions/browser/event_router.h"
42 #include "extensions/browser/extension_system.h" 42 #include "extensions/browser/extension_system.h"
43 #include "extensions/browser/info_map.h" 43 #include "extensions/browser/info_map.h"
44 #include "extensions/common/constants.h" 44 #include "extensions/common/constants.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 RenderViewHost* host = RenderViewHost::FromID(process_id_, route_id_); 275 RenderViewHost* host = RenderViewHost::FromID(process_id_, route_id_);
276 if (host) 276 if (host)
277 host->DesktopNotificationPermissionRequestDone(callback_context_); 277 host->DesktopNotificationPermissionRequestDone(callback_context_);
278 } 278 }
279 279
280 int NotificationPermissionInfoBarDelegate::GetIconID() const { 280 int NotificationPermissionInfoBarDelegate::GetIconID() const {
281 return IDR_INFOBAR_DESKTOP_NOTIFICATIONS; 281 return IDR_INFOBAR_DESKTOP_NOTIFICATIONS;
282 } 282 }
283 283
284 InfoBarDelegate::Type 284 infobars::InfoBarDelegate::Type
285 NotificationPermissionInfoBarDelegate::GetInfoBarType() const { 285 NotificationPermissionInfoBarDelegate::GetInfoBarType() const {
286 return PAGE_ACTION_TYPE; 286 return PAGE_ACTION_TYPE;
287 } 287 }
288 288
289 base::string16 NotificationPermissionInfoBarDelegate::GetMessageText() const { 289 base::string16 NotificationPermissionInfoBarDelegate::GetMessageText() const {
290 return l10n_util::GetStringFUTF16(IDS_NOTIFICATION_PERMISSIONS, 290 return l10n_util::GetStringFUTF16(IDS_NOTIFICATION_PERMISSIONS,
291 display_name_); 291 display_name_);
292 } 292 }
293 293
294 base::string16 NotificationPermissionInfoBarDelegate::GetButtonLabel( 294 base::string16 NotificationPermissionInfoBarDelegate::GetButtonLabel(
295 InfoBarButton button) const { 295 InfoBarButton button) const {
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 // Tell the IO thread that this extension's permission for notifications 763 // Tell the IO thread that this extension's permission for notifications
764 // has changed. 764 // has changed.
765 extensions::InfoMap* extension_info_map = 765 extensions::InfoMap* extension_info_map =
766 extensions::ExtensionSystem::Get(profile_)->info_map(); 766 extensions::ExtensionSystem::Get(profile_)->info_map();
767 BrowserThread::PostTask( 767 BrowserThread::PostTask(
768 BrowserThread::IO, FROM_HERE, 768 BrowserThread::IO, FROM_HERE,
769 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, 769 base::Bind(&extensions::InfoMap::SetNotificationsDisabled,
770 extension_info_map, notifier_id.id, !enabled)); 770 extension_info_map, notifier_id.id, !enabled));
771 771
772 } 772 }
OLDNEW
« no previous file with comments | « chrome/browser/nacl_host/nacl_infobar_delegate.cc ('k') | chrome/browser/notifications/notification_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698