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

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

Issue 2921263002: Remove many delegates, let's see what breaks
Patch Set: compile Created 3 years, 6 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/notification_display_service.h" 5 #include "chrome/browser/notifications/notification_display_service.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/nullable_string16.h" 8 #include "base/strings/nullable_string16.h"
9 #include "chrome/browser/notifications/non_persistent_notification_handler.h" 9 #include "chrome/browser/notifications/non_persistent_notification_handler.h"
10 #include "chrome/browser/notifications/notification_common.h" 10 #include "chrome/browser/notifications/notification_common.h"
11 #include "chrome/browser/notifications/persistent_notification_handler.h" 11 #include "chrome/browser/notifications/persistent_notification_handler.h"
12 #include "extensions/features/features.h" 12 #include "extensions/features/features.h"
13 #include "url/gurl.h"
13 14
14 #if BUILDFLAG(ENABLE_EXTENSIONS) 15 #if BUILDFLAG(ENABLE_EXTENSIONS)
15 #include "chrome/browser/extensions/api/notifications/extension_notification_han dler.h" 16 #include "chrome/browser/extensions/api/notifications/extension_notification_han dler.h"
16 #endif 17 #endif
17 18
18 NotificationDisplayService::NotificationDisplayService(Profile* profile) 19 NotificationDisplayService::NotificationDisplayService(Profile* profile)
19 : profile_(profile) { 20 : profile_(profile) {
20 AddNotificationHandler(NotificationCommon::NON_PERSISTENT, 21 AddNotificationHandler(NotificationCommon::NON_PERSISTENT,
21 base::MakeUnique<NonPersistentNotificationHandler>()); 22 base::MakeUnique<NonPersistentNotificationHandler>());
22 AddNotificationHandler(NotificationCommon::PERSISTENT, 23 AddNotificationHandler(NotificationCommon::PERSISTENT,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 handler->OnClick(profile_, origin, notification_id, action_index, reply); 65 handler->OnClick(profile_, origin, notification_id, action_index, reply);
65 break; 66 break;
66 case NotificationCommon::CLOSE: 67 case NotificationCommon::CLOSE:
67 handler->OnClose(profile_, origin, notification_id, true /* by_user */); 68 handler->OnClose(profile_, origin, notification_id, true /* by_user */);
68 break; 69 break;
69 case NotificationCommon::SETTINGS: 70 case NotificationCommon::SETTINGS:
70 handler->OpenSettings(profile_); 71 handler->OpenSettings(profile_);
71 break; 72 break;
72 } 73 }
73 } 74 }
75
76 bool NotificationDisplayService::ShouldDisplayOverFullscreen(
77 const GURL& origin,
78 NotificationCommon::Type notification_type) {
79 NotificationHandler* handler = GetNotificationHandler(notification_type);
80 return handler->ShouldDisplayOnFullScreen(profile_, origin.spec());
81 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/notification_display_service.h ('k') | chrome/browser/notifications/notification_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698