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

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

Issue 12340111: Introduce //components/user_prefs, use to eliminate c/b/prefs dependency in Autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge of LKGR Created 7 years, 9 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/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" 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
11 #include "chrome/browser/api/infobars/infobar_service.h" 11 #include "chrome/browser/api/infobars/infobar_service.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.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/extension_service.h" 16 #include "chrome/browser/extensions/extension_service.h"
17 #include "chrome/browser/extensions/extension_system.h" 17 #include "chrome/browser/extensions/extension_system.h"
18 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 18 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
19 #include "chrome/browser/notifications/notification.h" 19 #include "chrome/browser/notifications/notification.h"
20 #include "chrome/browser/notifications/notification_object_proxy.h" 20 #include "chrome/browser/notifications/notification_object_proxy.h"
21 #include "chrome/browser/notifications/notification_ui_manager.h" 21 #include "chrome/browser/notifications/notification_ui_manager.h"
22 #include "chrome/browser/prefs/pref_registry_syncable.h"
23 #include "chrome/browser/prefs/scoped_user_pref_update.h" 22 #include "chrome/browser/prefs/scoped_user_pref_update.h"
24 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/ui/browser.h" 24 #include "chrome/browser/ui/browser.h"
26 #include "chrome/common/chrome_notification_types.h" 25 #include "chrome/common/chrome_notification_types.h"
27 #include "chrome/common/content_settings.h" 26 #include "chrome/common/content_settings.h"
28 #include "chrome/common/content_settings_pattern.h" 27 #include "chrome/common/content_settings_pattern.h"
29 #include "chrome/common/pref_names.h" 28 #include "chrome/common/pref_names.h"
30 #include "chrome/common/url_constants.h" 29 #include "chrome/common/url_constants.h"
30 #include "components/user_prefs/pref_registry_syncable.h"
31 #include "content/public/browser/browser_thread.h" 31 #include "content/public/browser/browser_thread.h"
32 #include "content/public/browser/notification_service.h" 32 #include "content/public/browser/notification_service.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 "extensions/common/constants.h" 36 #include "extensions/common/constants.h"
37 #include "grit/browser_resources.h" 37 #include "grit/browser_resources.h"
38 #include "grit/chromium_strings.h" 38 #include "grit/chromium_strings.h"
39 #include "grit/generated_resources.h" 39 #include "grit/generated_resources.h"
40 #include "grit/theme_resources.h" 40 #include "grit/theme_resources.h"
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 602
603 if (setting == CONTENT_SETTING_ALLOW) 603 if (setting == CONTENT_SETTING_ALLOW)
604 return WebKit::WebNotificationPresenter::PermissionAllowed; 604 return WebKit::WebNotificationPresenter::PermissionAllowed;
605 if (setting == CONTENT_SETTING_BLOCK) 605 if (setting == CONTENT_SETTING_BLOCK)
606 return WebKit::WebNotificationPresenter::PermissionDenied; 606 return WebKit::WebNotificationPresenter::PermissionDenied;
607 if (setting == CONTENT_SETTING_ASK) 607 if (setting == CONTENT_SETTING_ASK)
608 return WebKit::WebNotificationPresenter::PermissionNotAllowed; 608 return WebKit::WebNotificationPresenter::PermissionNotAllowed;
609 NOTREACHED() << "Invalid notifications settings value: " << setting; 609 NOTREACHED() << "Invalid notifications settings value: " << setting;
610 return WebKit::WebNotificationPresenter::PermissionNotAllowed; 610 return WebKit::WebNotificationPresenter::PermissionNotAllowed;
611 } 611 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698