| 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 <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 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. Must be called on the UI thread. |
| 35 void SimulateClick(const std::string& title, int action_index); | 35 void SimulateClick(const std::string& title, int action_index); |
| 36 | 36 |
| 37 // Simulates the closing a notification titled |title|. Must be called on |
| 38 // the UI thread. |
| 39 void SimulateClose(const std::string& title, bool by_user); |
| 40 |
| 37 // PlatformNotificationService implementation. | 41 // PlatformNotificationService implementation. |
| 38 blink::WebNotificationPermission CheckPermissionOnUIThread( | 42 blink::WebNotificationPermission CheckPermissionOnUIThread( |
| 39 BrowserContext* browser_context, | 43 BrowserContext* browser_context, |
| 40 const GURL& origin, | 44 const GURL& origin, |
| 41 int render_process_id) override; | 45 int render_process_id) override; |
| 42 blink::WebNotificationPermission CheckPermissionOnIOThread( | 46 blink::WebNotificationPermission CheckPermissionOnIOThread( |
| 43 ResourceContext* resource_context, | 47 ResourceContext* resource_context, |
| 44 const GURL& origin, | 48 const GURL& origin, |
| 45 int render_process_id) override; | 49 int render_process_id) override; |
| 46 void DisplayNotification(BrowserContext* browser_context, | 50 void DisplayNotification(BrowserContext* browser_context, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 std::map<std::string, std::string> replacements_; | 93 std::map<std::string, std::string> replacements_; |
| 90 | 94 |
| 91 base::WeakPtrFactory<LayoutTestNotificationManager> weak_factory_; | 95 base::WeakPtrFactory<LayoutTestNotificationManager> weak_factory_; |
| 92 | 96 |
| 93 DISALLOW_COPY_AND_ASSIGN(LayoutTestNotificationManager); | 97 DISALLOW_COPY_AND_ASSIGN(LayoutTestNotificationManager); |
| 94 }; | 98 }; |
| 95 | 99 |
| 96 } // content | 100 } // content |
| 97 | 101 |
| 98 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_ | 102 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_ |
| OLD | NEW |