| 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/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/api/infobars/confirm_infobar_delegate.h" |
| 11 #include "chrome/browser/api/infobars/infobar_tab_helper.h" |
| 10 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/content_settings/content_settings_details.h" | 13 #include "chrome/browser/content_settings/content_settings_details.h" |
| 12 #include "chrome/browser/content_settings/content_settings_provider.h" | 14 #include "chrome/browser/content_settings/content_settings_provider.h" |
| 13 #include "chrome/browser/content_settings/host_content_settings_map.h" | 15 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 14 #include "chrome/browser/extensions/extension_service.h" | 16 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "chrome/browser/infobars/infobar_tab_helper.h" | |
| 16 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 17 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 17 #include "chrome/browser/notifications/notification.h" | 18 #include "chrome/browser/notifications/notification.h" |
| 18 #include "chrome/browser/notifications/notification_object_proxy.h" | 19 #include "chrome/browser/notifications/notification_object_proxy.h" |
| 19 #include "chrome/browser/notifications/notification_ui_manager.h" | 20 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 20 #include "chrome/browser/prefs/pref_service.h" | 21 #include "chrome/browser/prefs/pref_service.h" |
| 21 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 22 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | |
| 24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
| 25 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 25 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 26 #include "chrome/browser/ui/webui/web_ui_util.h" | 26 #include "chrome/browser/ui/webui/web_ui_util.h" |
| 27 #include "chrome/common/chrome_notification_types.h" | 27 #include "chrome/common/chrome_notification_types.h" |
| 28 #include "chrome/common/content_settings.h" | 28 #include "chrome/common/content_settings.h" |
| 29 #include "chrome/common/content_settings_pattern.h" | 29 #include "chrome/common/content_settings_pattern.h" |
| 30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
| 31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
| 32 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
| 33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 518 |
| 519 if (setting == CONTENT_SETTING_ALLOW) | 519 if (setting == CONTENT_SETTING_ALLOW) |
| 520 return WebKit::WebNotificationPresenter::PermissionAllowed; | 520 return WebKit::WebNotificationPresenter::PermissionAllowed; |
| 521 if (setting == CONTENT_SETTING_BLOCK) | 521 if (setting == CONTENT_SETTING_BLOCK) |
| 522 return WebKit::WebNotificationPresenter::PermissionDenied; | 522 return WebKit::WebNotificationPresenter::PermissionDenied; |
| 523 if (setting == CONTENT_SETTING_ASK) | 523 if (setting == CONTENT_SETTING_ASK) |
| 524 return WebKit::WebNotificationPresenter::PermissionNotAllowed; | 524 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 525 NOTREACHED() << "Invalid notifications settings value: " << setting; | 525 NOTREACHED() << "Invalid notifications settings value: " << setting; |
| 526 return WebKit::WebNotificationPresenter::PermissionNotAllowed; | 526 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 527 } | 527 } |
| OLD | NEW |