OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 4023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4034 void HTMLMediaElement::mediaPlayerMediaSourceOpened(blink::WebMediaSource* webMe
diaSource) | 4034 void HTMLMediaElement::mediaPlayerMediaSourceOpened(blink::WebMediaSource* webMe
diaSource) |
4035 { | 4035 { |
4036 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); | 4036 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); |
4037 } | 4037 } |
4038 | 4038 |
4039 bool HTMLMediaElement::isInteractiveContent() const | 4039 bool HTMLMediaElement::isInteractiveContent() const |
4040 { | 4040 { |
4041 return fastHasAttribute(controlsAttr); | 4041 return fastHasAttribute(controlsAttr); |
4042 } | 4042 } |
4043 | 4043 |
| 4044 bool HTMLMediaElement::willRespondToMouseClickEvents() |
| 4045 { |
| 4046 return fastHasAttribute(controlsAttr); |
| 4047 } |
| 4048 |
4044 void HTMLMediaElement::defaultEventHandler(Event* event) | 4049 void HTMLMediaElement::defaultEventHandler(Event* event) |
4045 { | 4050 { |
| 4051 if (event->type() == EventTypeNames::click && willRespondToMouseClickEvents(
)) { |
| 4052 togglePlayState(); |
| 4053 event->setDefaultHandled(); |
| 4054 return; |
| 4055 } |
| 4056 |
4046 if (event->type() == EventTypeNames::focusin) { | 4057 if (event->type() == EventTypeNames::focusin) { |
4047 if (hasMediaControls()) | 4058 if (hasMediaControls()) |
4048 mediaControls()->mediaElementFocused(); | 4059 mediaControls()->mediaElementFocused(); |
4049 } | 4060 } |
| 4061 |
4050 HTMLElement::defaultEventHandler(event); | 4062 HTMLElement::defaultEventHandler(event); |
4051 } | 4063 } |
4052 | 4064 |
4053 void HTMLMediaElement::trace(Visitor* visitor) | 4065 void HTMLMediaElement::trace(Visitor* visitor) |
4054 { | 4066 { |
4055 #if ENABLE(OILPAN) | 4067 #if ENABLE(OILPAN) |
4056 visitor->trace(m_playedTimeRanges); | 4068 visitor->trace(m_playedTimeRanges); |
4057 visitor->trace(m_asyncEventQueue); | 4069 visitor->trace(m_asyncEventQueue); |
4058 visitor->trace(m_error); | 4070 visitor->trace(m_error); |
4059 visitor->trace(m_currentSourceNode); | 4071 visitor->trace(m_currentSourceNode); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4103 | 4115 |
4104 #if ENABLE(WEB_AUDIO) | 4116 #if ENABLE(WEB_AUDIO) |
4105 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) | 4117 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) |
4106 { | 4118 { |
4107 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) | 4119 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) |
4108 audioSourceProvider()->setClient(nullptr); | 4120 audioSourceProvider()->setClient(nullptr); |
4109 } | 4121 } |
4110 #endif | 4122 #endif |
4111 | 4123 |
4112 } | 4124 } |
OLD | NEW |