| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/content_settings/content_settings_details.h" | 10 #include "chrome/browser/content_settings/content_settings_details.h" |
| 11 #include "chrome/browser/content_settings/content_settings_pattern.h" | |
| 12 #include "chrome/browser/content_settings/content_settings_provider.h" | 11 #include "chrome/browser/content_settings/content_settings_provider.h" |
| 13 #include "chrome/browser/content_settings/host_content_settings_map.h" | 12 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 14 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "chrome/browser/infobars/infobar_tab_helper.h" | 14 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 16 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 15 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 17 #include "chrome/browser/notifications/notification.h" | 16 #include "chrome/browser/notifications/notification.h" |
| 18 #include "chrome/browser/notifications/notification_object_proxy.h" | 17 #include "chrome/browser/notifications/notification_object_proxy.h" |
| 19 #include "chrome/browser/notifications/notification_ui_manager.h" | 18 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 20 #include "chrome/browser/prefs/pref_service.h" | 19 #include "chrome/browser/prefs/pref_service.h" |
| 21 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 20 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 22 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
| 24 #include "chrome/browser/ui/browser_list.h" | 23 #include "chrome/browser/ui/browser_list.h" |
| 25 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 26 #include "chrome/common/chrome_notification_types.h" | 25 #include "chrome/common/chrome_notification_types.h" |
| 26 #include "chrome/common/content_settings_pattern.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 29 #include "content/browser/browser_child_process_host.h" | 29 #include "content/browser/browser_child_process_host.h" |
| 30 #include "content/browser/browser_thread.h" | 30 #include "content/browser/browser_thread.h" |
| 31 #include "content/browser/renderer_host/render_process_host.h" | 31 #include "content/browser/renderer_host/render_process_host.h" |
| 32 #include "content/browser/renderer_host/render_view_host.h" | 32 #include "content/browser/renderer_host/render_view_host.h" |
| 33 #include "content/browser/site_instance.h" | 33 #include "content/browser/site_instance.h" |
| 34 #include "content/browser/worker_host/worker_process_host.h" | 34 #include "content/browser/worker_host/worker_process_host.h" |
| 35 #include "content/common/desktop_notification_messages.h" | 35 #include "content/common/desktop_notification_messages.h" |
| 36 #include "content/common/notification_service.h" | 36 #include "content/common/notification_service.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 431 |
| 432 if (setting == CONTENT_SETTING_ALLOW) | 432 if (setting == CONTENT_SETTING_ALLOW) |
| 433 return WebKit::WebNotificationPresenter::PermissionAllowed; | 433 return WebKit::WebNotificationPresenter::PermissionAllowed; |
| 434 if (setting == CONTENT_SETTING_BLOCK) | 434 if (setting == CONTENT_SETTING_BLOCK) |
| 435 return WebKit::WebNotificationPresenter::PermissionDenied; | 435 return WebKit::WebNotificationPresenter::PermissionDenied; |
| 436 if (setting == CONTENT_SETTING_ASK) | 436 if (setting == CONTENT_SETTING_ASK) |
| 437 return WebKit::WebNotificationPresenter::PermissionNotAllowed; | 437 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 438 NOTREACHED() << "Invalid notifications settings value: " << setting; | 438 NOTREACHED() << "Invalid notifications settings value: " << setting; |
| 439 return WebKit::WebNotificationPresenter::PermissionNotAllowed; | 439 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 440 } | 440 } |
| OLD | NEW |