OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_TEST_API_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_TEST_API_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "chrome/browser/permissions/permission_request_manager.h" |
| 10 #include "content/public/browser/permission_type.h" |
| 11 |
| 12 class Browser; |
| 13 class Profile; |
| 14 |
| 15 namespace test { |
| 16 |
| 17 class PermissionRequestManagerTestApi { |
| 18 public: |
| 19 explicit PermissionRequestManagerTestApi(PermissionRequestManager* manager); |
| 20 |
| 21 // Wraps the PermissionRequestManager for the active tab in |browser|. |
| 22 explicit PermissionRequestManagerTestApi(Browser* browser); |
| 23 |
| 24 PermissionRequestManager* manager() { return manager_; } |
| 25 |
| 26 // Add a "simple" permission request. One that uses PermissionRequestImpl, |
| 27 // such as for content::PermissionType including MIDI_SYSEX, PUSH_MESSAGING, |
| 28 // NOTIFICATIONS, GEOLOCATON, or FLASH. This can be called multiple times |
| 29 // before a call to manager()->DisplayPendingRequests(). |
| 30 void AddSimpleRequest(Profile* profile, content::PermissionType type); |
| 31 |
| 32 // Return the bubble window for the permission prompt or null if there is no |
| 33 // prompt currently showing. |
| 34 gfx::NativeWindow GetPromptWindow(); |
| 35 |
| 36 private: |
| 37 PermissionRequestManager* manager_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(PermissionRequestManagerTestApi); |
| 40 }; |
| 41 |
| 42 } // namespace test |
| 43 |
| 44 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_TEST_API_H_ |
OLD | NEW |