MediaStream API: Use the source id when creating new tracks
https://bugs.webkit.org/show_bug.cgi?id=109688

Reviewed by Adam Barth.

Source/Platform:

Added id to initialize and renamed audio/videoSources to audio/videoTracks.

* chromium/public/WebMediaStream.h:
(WebKit):
(WebMediaStream):
(WebKit::WebMediaStream::audioSources):
(WebKit::WebMediaStream::videoSources):
* chromium/public/WebMediaStreamTrack.h:
(WebMediaStreamTrack):

Source/WebCore:

This patch reuses the ids from the source when creating tracks instead of creating a new one.
This was requested by the chromium port to greatly simplify their implementation.
In the longer run the API should be rewritten to only use tracks instead of sources.

Covered by existing tests.

* platform/chromium/support/WebMediaStream.cpp:
(WebKit::WebMediaStream::audioTracks):
(WebKit::WebMediaStream::videoTracks):
(WebKit::WebMediaStream::initialize):
(WebKit):
* platform/chromium/support/WebMediaStreamTrack.cpp:
(WebKit::WebMediaStreamTrack::initialize):
(WebKit):
* platform/mediastream/MediaStreamComponent.h:
(WebCore::MediaStreamComponent::create):
(MediaStreamComponent):
(WebCore::MediaStreamComponent::MediaStreamComponent):
(WebCore):
* platform/mediastream/MediaStreamDescriptor.h:
(WebCore::MediaStreamDescriptor::create):
(MediaStreamDescriptor):
(WebCore::MediaStreamDescriptor::MediaStreamDescriptor):

Tools:

Switching mock to new API.

* DumpRenderTree/chromium/TestRunner/src/WebUserMediaClientMock.cpp:
(WebTestRunner::WebUserMediaClientMock::requestUserMedia):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clicking outside captions menu should dismiss it
https://bugs.webkit.org/show_bug.cgi?id=109648

Reviewed by Eric Carlson.

Source/WebCore:

Add a virtual override to the platform-specific
defaultEventHandler to intercept any click in the controls,
and hide the captions menu if it is showing.

Test: media/video-controls-captions-trackmenu-hide-on-click.html

* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::defaultEventHandler): Override from MediaControls. Hide
    captions menu if a click event comes in.
* html/shadow/MediaControlsApple.h:

LayoutTests:

New test for captions menu. Skip it everywhere but Mac.

* media/video-controls-captions-trackmenu-hide-on-click.html: Added.
* platform/mac/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142774 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Small update to speech bubble for captions menu [Mac]
https://bugs.webkit.org/show_bug.cgi?id=109641

Reviewed by Eric Carlson

Small adjustment to the embedded SVG that draws a speech bubble
for the captions button. Remove a polygon that was so small
it looked like a rendering error.

* css/mediaControlsQuickTime.css:
(video::-webkit-media-controls-toggle-closed-captions-button):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142775 268f45cc-cd09-0410-ab3c-d52691b4dbfc