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

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

Issue 1895473002: PlatformNotificationService layering cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@display_manager2
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/platform_notification_service_impl.h" 5 #include "chrome/browser/notifications/platform_notification_service_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 content::PersistentNotificationStatus status) { 86 content::PersistentNotificationStatus status) {
87 UMA_HISTOGRAM_ENUMERATION( 87 UMA_HISTOGRAM_ENUMERATION(
88 "Notifications.PersistentWebNotificationCloseResult", status, 88 "Notifications.PersistentWebNotificationCloseResult", status,
89 content::PersistentNotificationStatus:: 89 content::PersistentNotificationStatus::
90 PERSISTENT_NOTIFICATION_STATUS_MAX); 90 PERSISTENT_NOTIFICATION_STATUS_MAX);
91 } 91 }
92 92
93 void OnCloseNonPersistentNotificationProfileLoaded( 93 void OnCloseNonPersistentNotificationProfileLoaded(
94 const std::string& notification_id, 94 const std::string& notification_id,
95 Profile* profile) { 95 Profile* profile) {
96 PlatformNotificationServiceImpl::GetInstance() 96 NotificationDisplayServiceFactory::GetForProfile(profile)->Close(
97 ->GetNotificationDisplayService(profile) 97 notification_id);
98 ->Close(notification_id);
99 } 98 }
100 99
101 // Callback to run once the profile has been loaded in order to perform a 100 // Callback to run once the profile has been loaded in order to perform a
102 // given |operation| in a notification. 101 // given |operation| in a notification.
103 void ProfileLoadedCallback( 102 void ProfileLoadedCallback(
104 PlatformNotificationServiceImpl::NotificationOperation operation, 103 PlatformNotificationServiceImpl::NotificationOperation operation,
105 const GURL& origin, 104 const GURL& origin,
106 int64_t persistent_notification_id, 105 int64_t persistent_notification_id,
107 int action_index, 106 int action_index,
108 Profile* profile) { 107 Profile* profile) {
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 } 538 }
540 #endif 539 #endif
541 540
542 return base::string16(); 541 return base::string16();
543 } 542 }
544 543
545 void PlatformNotificationServiceImpl::SetNotificationDisplayServiceForTesting( 544 void PlatformNotificationServiceImpl::SetNotificationDisplayServiceForTesting(
546 NotificationDisplayService* display_service) { 545 NotificationDisplayService* display_service) {
547 test_display_service_ = display_service; 546 test_display_service_ = display_service;
548 } 547 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698