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

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: fix layout tests 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);
Miguel Garcia 2016/12/06 12:01:18 Note that I have removed this restriction since we
90 DCHECK(displayed_notifications); 89 DCHECK(displayed_notifications);
91 90
92 // Notifications will never outlive the lifetime of running layout tests. 91 // Notifications will never outlive the lifetime of running layout tests.
93 return false; 92 return false;
94 } 93 }
95 94
96 void LayoutTestNotificationManager::SimulateClick( 95 void LayoutTestNotificationManager::SimulateClick(
97 const std::string& title, 96 const std::string& title,
98 int action_index, 97 int action_index,
99 const base::NullableString16& reply) { 98 const base::NullableString16& reply) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 LayoutTestNotificationManager::CheckPermission(const GURL& origin) { 191 LayoutTestNotificationManager::CheckPermission(const GURL& origin) {
193 return LayoutTestContentBrowserClient::Get() 192 return LayoutTestContentBrowserClient::Get()
194 ->GetLayoutTestBrowserContext() 193 ->GetLayoutTestBrowserContext()
195 ->GetLayoutTestPermissionManager() 194 ->GetLayoutTestPermissionManager()
196 ->GetPermissionStatus(PermissionType::NOTIFICATIONS, 195 ->GetPermissionStatus(PermissionType::NOTIFICATIONS,
197 origin, 196 origin,
198 origin); 197 origin);
199 } 198 }
200 199
201 } // namespace content 200 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698