2 * Copyright (C) 2000 Harri Porten (porten@kde.org)
3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org)
4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #include "modules/mediastream/NavigatorMediaStream.h"
26 #include "bindings/v8/Dictionary.h"
27 #include "bindings/v8/ExceptionState.h"
28 #include "core/dom/Document.h"
29 #include "core/dom/ExceptionCode.h"
30 #include "core/frame/Frame.h"
31 #include "core/frame/Navigator.h"
32 #include "core/page/Page.h"
33 #include "modules/mediastream/MediaDeviceInfoCallback.h"
34 #include "modules/mediastream/MediaDevicesRequest.h"
35 #include "modules/mediastream/NavigatorUserMediaErrorCallback.h"
36 #include "modules/mediastream/NavigatorUserMediaSuccessCallback.h"
37 #include "modules/mediastream/UserMediaController.h"
38 #include "modules/mediastream/UserMediaRequest.h"
42 NavigatorMediaStream::NavigatorMediaStream()
46 NavigatorMediaStream::~NavigatorMediaStream()
50 void NavigatorMediaStream::webkitGetUserMedia(Navigator* navigator, const Dictionary& options, PassOwnPtr<NavigatorUserMediaSuccessCallback> successCallback, PassOwnPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionState& exceptionState)
55 UserMediaController* userMedia = UserMediaController::from(navigator->frame() ? navigator->frame()->page() : 0);
57 exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
61 RefPtr<UserMediaRequest> request = UserMediaRequest::create(navigator->frame()->document(), userMedia, options, successCallback, errorCallback, exceptionState);
63 exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
70 void NavigatorMediaStream::getMediaDevices(Navigator* navigator, PassOwnPtr<MediaDeviceInfoCallback> callback, ExceptionState& exceptionState)
72 UserMediaController* userMedia = UserMediaController::from(navigator->frame() ? navigator->frame()->page() : 0);
74 exceptionState.throwDOMException(NotSupportedError, "Not implemented.");
78 RefPtr<MediaDevicesRequest> request = MediaDevicesRequest::create(navigator->frame()->document(), userMedia, callback, exceptionState);
80 exceptionState.throwDOMException(NotSupportedError, "Not implemented.");
87 } // namespace WebCore