| 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_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_ |
| 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_ | 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // Responsible for tracking active notifications and allowed origins for the | 25 // Responsible for tracking active notifications and allowed origins for the |
| 26 // Web Notification API when running layout tests. | 26 // Web Notification API when running layout tests. |
| 27 class LayoutTestNotificationManager : public PlatformNotificationService { | 27 class LayoutTestNotificationManager : public PlatformNotificationService { |
| 28 public: | 28 public: |
| 29 LayoutTestNotificationManager(); | 29 LayoutTestNotificationManager(); |
| 30 ~LayoutTestNotificationManager() override; | 30 ~LayoutTestNotificationManager() override; |
| 31 | 31 |
| 32 // Simulates a click on the notification titled |title|. |action_index| | 32 // Simulates a click on the notification titled |title|. |action_index| |
| 33 // indicates which action was clicked, or -1 if the main notification body was | 33 // indicates which action was clicked, or -1 if the main notification body was |
| 34 // clicked. Must be called on the UI thread. | 34 // clicked. |reply| indicates the user reply, if any. |
| 35 void SimulateClick(const std::string& title, int action_index); | 35 // Must be called on the UI thread. |
| 36 void SimulateClick(const std::string& title, |
| 37 int action_index, |
| 38 const base::NullableString16& reply); |
| 36 | 39 |
| 37 // Simulates the closing a notification titled |title|. Must be called on | 40 // Simulates the closing a notification titled |title|. Must be called on |
| 38 // the UI thread. | 41 // the UI thread. |
| 39 void SimulateClose(const std::string& title, bool by_user); | 42 void SimulateClose(const std::string& title, bool by_user); |
| 40 | 43 |
| 41 // PlatformNotificationService implementation. | 44 // PlatformNotificationService implementation. |
| 42 blink::mojom::PermissionStatus CheckPermissionOnUIThread( | 45 blink::mojom::PermissionStatus CheckPermissionOnUIThread( |
| 43 BrowserContext* browser_context, | 46 BrowserContext* browser_context, |
| 44 const GURL& origin, | 47 const GURL& origin, |
| 45 int render_process_id) override; | 48 int render_process_id) override; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 std::unordered_map<std::string, std::string> notification_id_map_; | 98 std::unordered_map<std::string, std::string> notification_id_map_; |
| 96 | 99 |
| 97 base::WeakPtrFactory<LayoutTestNotificationManager> weak_factory_; | 100 base::WeakPtrFactory<LayoutTestNotificationManager> weak_factory_; |
| 98 | 101 |
| 99 DISALLOW_COPY_AND_ASSIGN(LayoutTestNotificationManager); | 102 DISALLOW_COPY_AND_ASSIGN(LayoutTestNotificationManager); |
| 100 }; | 103 }; |
| 101 | 104 |
| 102 } // content | 105 } // content |
| 103 | 106 |
| 104 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_ | 107 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_ |
| OLD | NEW |