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

Side by Side Diff: content/test/mock_platform_notification_service.h

Issue 2749453002: Make GetDisplayedNotifications asynchronous. (Closed)
Patch Set: review Created 3 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
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 #ifndef CONTENT_TEST_MOCK_PLATFORM_NOTIFICATION_SERVICE_H_ 5 #ifndef CONTENT_TEST_MOCK_PLATFORM_NOTIFICATION_SERVICE_H_
6 #define CONTENT_TEST_MOCK_PLATFORM_NOTIFICATION_SERVICE_H_ 6 #define CONTENT_TEST_MOCK_PLATFORM_NOTIFICATION_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include <unordered_map> 10 #include <unordered_map>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 base::Closure* cancel_callback) override; 64 base::Closure* cancel_callback) override;
65 void DisplayPersistentNotification( 65 void DisplayPersistentNotification(
66 BrowserContext* browser_context, 66 BrowserContext* browser_context,
67 const std::string& notification_id, 67 const std::string& notification_id,
68 const GURL& service_worker_scope, 68 const GURL& service_worker_scope,
69 const GURL& origin, 69 const GURL& origin,
70 const PlatformNotificationData& notification_data, 70 const PlatformNotificationData& notification_data,
71 const NotificationResources& notification_resources) override; 71 const NotificationResources& notification_resources) override;
72 void ClosePersistentNotification(BrowserContext* browser_context, 72 void ClosePersistentNotification(BrowserContext* browser_context,
73 const std::string& notification_id) override; 73 const std::string& notification_id) override;
74 bool GetDisplayedNotifications( 74 void GetDisplayedNotifications(
75 BrowserContext* browser_context, 75 BrowserContext* browser_context,
76 std::set<std::string>* displayed_notifications) override; 76 const DisplayedNotificationsCallback& callback) override;
77 77
78 protected: 78 protected:
79 // Checks if |origin| has permission to display notifications. May be called 79 // Checks if |origin| has permission to display notifications. May be called
80 // on both the IO and the UI threads. 80 // on both the IO and the UI threads.
81 virtual blink::mojom::PermissionStatus CheckPermission(const GURL& origin); 81 virtual blink::mojom::PermissionStatus CheckPermission(const GURL& origin);
82 82
83 private: 83 private:
84 // Structure to represent the information of a persistent notification. 84 // Structure to represent the information of a persistent notification.
85 struct PersistentNotification { 85 struct PersistentNotification {
86 BrowserContext* browser_context = nullptr; 86 BrowserContext* browser_context = nullptr;
(...skipping 16 matching lines...) Expand all
103 std::unordered_map<std::string, std::string> notification_id_map_; 103 std::unordered_map<std::string, std::string> notification_id_map_;
104 104
105 base::WeakPtrFactory<MockPlatformNotificationService> weak_factory_; 105 base::WeakPtrFactory<MockPlatformNotificationService> weak_factory_;
106 106
107 DISALLOW_COPY_AND_ASSIGN(MockPlatformNotificationService); 107 DISALLOW_COPY_AND_ASSIGN(MockPlatformNotificationService);
108 }; 108 };
109 109
110 } // content 110 } // content
111 111
112 #endif // CONTENT_TEST_MOCK_PLATFORM_NOTIFICATION_SERVICE_H_ 112 #endif // CONTENT_TEST_MOCK_PLATFORM_NOTIFICATION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698