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
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_NATIVE_PERMISSION_MEDIA_ACCESS_PERMISSION_REQUEST_H
6 #define ANDROID_WEBVIEW_NATIVE_PERMISSION_MEDIA_ACCESS_PERMISSION_REQUEST_H
8 #include "android_webview/native/permission/aw_permission_request_delegate.h"
9 #include "base/callback.h"
10 #include "content/public/common/media_stream_request.h"
12 namespace android_webview
{
14 // The AwPermissionRequestDelegate implementation for media access permission
16 class MediaAccessPermissionRequest
: public AwPermissionRequestDelegate
{
18 MediaAccessPermissionRequest(const content::MediaStreamRequest
& request
,
19 const content::MediaResponseCallback
& callback
);
20 virtual ~MediaAccessPermissionRequest();
22 // AwPermissionRequestDelegate implementation.
23 virtual const GURL
& GetOrigin() OVERRIDE
;
24 virtual int64
GetResources() OVERRIDE
;
25 virtual void NotifyRequestResult(bool allowed
) OVERRIDE
;
28 friend class TestMediaAccessPermissionRequest
;
30 const content::MediaStreamRequest request_
;
31 const content::MediaResponseCallback callback_
;
34 content::MediaStreamDevices audio_test_devices_
;
35 content::MediaStreamDevices video_test_devices_
;
37 DISALLOW_COPY_AND_ASSIGN(MediaAccessPermissionRequest
);
40 } // namespace android_webview
42 #endif // ANDROID_WEBVIEW_NATIVE_PERMISSION_MEDIA_ACCESS_PERMISSION_REQUEST_H