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

Side by Side Diff: content/shell/browser/layout_test/layout_test_notification_manager.cc

Issue 2534443002: Use notification display service to collect persistent notifications. (Closed)
Patch Set: threading Created 4 years 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 "content/shell/browser/layout_test/layout_test_notification_manager.h" 5 #include "content/shell/browser/layout_test/layout_test_notification_manager.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "base/strings/nullable_string16.h" 8 #include "base/strings/nullable_string16.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 void LayoutTestNotificationManager::ClosePersistentNotification( 78 void LayoutTestNotificationManager::ClosePersistentNotification(
79 BrowserContext* browser_context, 79 BrowserContext* browser_context,
80 const std::string& notification_id) { 80 const std::string& notification_id) {
81 DCHECK_CURRENTLY_ON(BrowserThread::UI); 81 DCHECK_CURRENTLY_ON(BrowserThread::UI);
82 82
83 persistent_notifications_.erase(notification_id); 83 persistent_notifications_.erase(notification_id);
84 } 84 }
85 85
86 bool LayoutTestNotificationManager::GetDisplayedPersistentNotifications( 86 bool LayoutTestNotificationManager::GetDisplayedNotifications(
87 BrowserContext* browser_context, 87 BrowserContext* browser_context,
88 std::set<std::string>* displayed_notifications) { 88 std::set<std::string>* displayed_notifications) {
89 DCHECK_CURRENTLY_ON(BrowserThread::UI); 89 DCHECK_CURRENTLY_ON(BrowserThread::UI);
90 DCHECK(displayed_notifications); 90 DCHECK(displayed_notifications);
91 91
92 // Notifications will never outlive the lifetime of running layout tests. 92 // Notifications will never outlive the lifetime of running layout tests.
93 return false; 93 return false;
94 } 94 }
95 95
96 void LayoutTestNotificationManager::SimulateClick( 96 void LayoutTestNotificationManager::SimulateClick(
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 LayoutTestNotificationManager::CheckPermission(const GURL& origin) { 192 LayoutTestNotificationManager::CheckPermission(const GURL& origin) {
193 return LayoutTestContentBrowserClient::Get() 193 return LayoutTestContentBrowserClient::Get()
194 ->GetLayoutTestBrowserContext() 194 ->GetLayoutTestBrowserContext()
195 ->GetLayoutTestPermissionManager() 195 ->GetLayoutTestPermissionManager()
196 ->GetPermissionStatus(PermissionType::NOTIFICATIONS, 196 ->GetPermissionStatus(PermissionType::NOTIFICATIONS,
197 origin, 197 origin,
198 origin); 198 origin);
199 } 199 }
200 200
201 } // namespace content 201 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698