Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 base::Callback<void(std::unique_ptr<std::set<std::string>>, |
| 77 bool /* success */)>& callback) override; | |
|
Peter Beverloo
2017/03/15 18:07:51
Why doesn't this use the typedef?
Miguel Garcia
2017/03/16 14:57:43
Done.
| |
| 77 | 78 |
| 78 protected: | 79 protected: |
| 79 // Checks if |origin| has permission to display notifications. May be called | 80 // Checks if |origin| has permission to display notifications. May be called |
| 80 // on both the IO and the UI threads. | 81 // on both the IO and the UI threads. |
| 81 virtual blink::mojom::PermissionStatus CheckPermission(const GURL& origin); | 82 virtual blink::mojom::PermissionStatus CheckPermission(const GURL& origin); |
| 82 | 83 |
| 83 private: | 84 private: |
| 84 // Structure to represent the information of a persistent notification. | 85 // Structure to represent the information of a persistent notification. |
| 85 struct PersistentNotification { | 86 struct PersistentNotification { |
| 86 BrowserContext* browser_context = nullptr; | 87 BrowserContext* browser_context = nullptr; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 103 std::unordered_map<std::string, std::string> notification_id_map_; | 104 std::unordered_map<std::string, std::string> notification_id_map_; |
| 104 | 105 |
| 105 base::WeakPtrFactory<MockPlatformNotificationService> weak_factory_; | 106 base::WeakPtrFactory<MockPlatformNotificationService> weak_factory_; |
| 106 | 107 |
| 107 DISALLOW_COPY_AND_ASSIGN(MockPlatformNotificationService); | 108 DISALLOW_COPY_AND_ASSIGN(MockPlatformNotificationService); |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 } // content | 111 } // content |
| 111 | 112 |
| 112 #endif // CONTENT_TEST_MOCK_PLATFORM_NOTIFICATION_SERVICE_H_ | 113 #endif // CONTENT_TEST_MOCK_PLATFORM_NOTIFICATION_SERVICE_H_ |
| OLD | NEW |