philn@webkit.org | 13b9094 | 2014-11-12 08:25:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 Igalia S.L. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | */ |
| 18 | |
| 19 | #ifndef UserMediaPermissionRequestManagerProxy_h |
| 20 | #define UserMediaPermissionRequestManagerProxy_h |
| 21 | |
| 22 | #include "UserMediaPermissionRequestProxy.h" |
| 23 | #include <wtf/HashMap.h> |
| 24 | |
| 25 | namespace WebKit { |
| 26 | |
| 27 | class WebPageProxy; |
| 28 | |
| 29 | class UserMediaPermissionRequestManagerProxy { |
| 30 | public: |
| 31 | explicit UserMediaPermissionRequestManagerProxy(WebPageProxy&); |
| 32 | |
| 33 | void invalidateRequests(); |
| 34 | |
| 35 | // Create a request to be presented to the user. |
eric.carlson@apple.com | e3b6cc0 | 2015-09-26 02:23:00 +0000 | [diff] [blame] | 36 | PassRefPtr<UserMediaPermissionRequestProxy> createRequest(uint64_t userMediaID, const Vector<String>& audioDeviceUIDs, const Vector<String>& videoDeviceUIDs); |
philn@webkit.org | 13b9094 | 2014-11-12 08:25:05 +0000 | [diff] [blame] | 37 | |
| 38 | // Called by UserMediaPermissionRequestProxy when a decision is made by the user. |
eric.carlson@apple.com | e3b6cc0 | 2015-09-26 02:23:00 +0000 | [diff] [blame] | 39 | void didReceiveUserMediaPermissionDecision(uint64_t, bool allow, const String& audioDeviceUID, const String& videoDeviceUID); |
philn@webkit.org | 13b9094 | 2014-11-12 08:25:05 +0000 | [diff] [blame] | 40 | |
| 41 | private: |
| 42 | HashMap<uint64_t, RefPtr<UserMediaPermissionRequestProxy>> m_pendingRequests; |
| 43 | WebPageProxy& m_page; |
| 44 | }; |
| 45 | |
| 46 | } // namespace WebKit |
| 47 | |
| 48 | #endif // UserMediaPermissionRequestManagerProxy_h |