| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // Checks whether |origin| has permission to display notifications in tests. | 28 // Checks whether |origin| has permission to display notifications in tests. |
| 29 // Must be called on the IO thread. | 29 // Must be called on the IO thread. |
| 30 blink::WebNotificationPermission CheckPermission( | 30 blink::WebNotificationPermission CheckPermission( |
| 31 const GURL& origin); | 31 const GURL& origin); |
| 32 | 32 |
| 33 // Requests permission for |origin| to display notifications in layout tests. | 33 // Requests permission for |origin| to display notifications in layout tests. |
| 34 // Must be called on the IO thread. | 34 // Must be called on the IO thread. |
| 35 void RequestPermission( | 35 void RequestPermission( |
| 36 const GURL& origin, | 36 const GURL& origin, |
| 37 const base::Callback<void(blink::WebNotificationPermission)>& callback); | 37 const base::Callback<void(bool)>& callback); |
| 38 | 38 |
| 39 // Sets the permission to display notifications for |origin| to |permission|. | 39 // Sets the permission to display notifications for |origin| to |permission|. |
| 40 // Must be called on the IO thread. | 40 // Must be called on the IO thread. |
| 41 void SetPermission(const GURL& origin, | 41 void SetPermission(const GURL& origin, |
| 42 blink::WebNotificationPermission permission); | 42 blink::WebNotificationPermission permission); |
| 43 | 43 |
| 44 // Clears the currently granted permissions. Must be called on the IO thread. | 44 // Clears the currently granted permissions. Must be called on the IO thread. |
| 45 void ClearPermissions(); | 45 void ClearPermissions(); |
| 46 | 46 |
| 47 // Pretends to show the given notification for testing, storing a delegate so | 47 // Pretends to show the given notification for testing, storing a delegate so |
| (...skipping 19 matching lines...) Expand all Loading... |
| 67 std::map<std::string, std::string> replacements_; | 67 std::map<std::string, std::string> replacements_; |
| 68 | 68 |
| 69 base::WeakPtrFactory<LayoutTestNotificationManager> weak_factory_; | 69 base::WeakPtrFactory<LayoutTestNotificationManager> weak_factory_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(LayoutTestNotificationManager); | 71 DISALLOW_COPY_AND_ASSIGN(LayoutTestNotificationManager); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // content | 74 } // content |
| 75 | 75 |
| 76 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_ | 76 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_ |
| OLD | NEW |