blob: d45dbb321824b4883d9b84c8046997aa72e96640 [file] [log] [blame]
philn@webkit.org13b90942014-11-12 08:25:05 +00001/*
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
25namespace WebKit {
26
27class WebPageProxy;
28
29class UserMediaPermissionRequestManagerProxy {
30public:
31 explicit UserMediaPermissionRequestManagerProxy(WebPageProxy&);
32
33 void invalidateRequests();
34
35 // Create a request to be presented to the user.
eric.carlson@apple.come3b6cc02015-09-26 02:23:00 +000036 PassRefPtr<UserMediaPermissionRequestProxy> createRequest(uint64_t userMediaID, const Vector<String>& audioDeviceUIDs, const Vector<String>& videoDeviceUIDs);
philn@webkit.org13b90942014-11-12 08:25:05 +000037
38 // Called by UserMediaPermissionRequestProxy when a decision is made by the user.
eric.carlson@apple.come3b6cc02015-09-26 02:23:00 +000039 void didReceiveUserMediaPermissionDecision(uint64_t, bool allow, const String& audioDeviceUID, const String& videoDeviceUID);
philn@webkit.org13b90942014-11-12 08:25:05 +000040
41private:
42 HashMap<uint64_t, RefPtr<UserMediaPermissionRequestProxy>> m_pendingRequests;
43 WebPageProxy& m_page;
44};
45
46} // namespace WebKit
47
48#endif // UserMediaPermissionRequestManagerProxy_h