Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: Source/core/html/HTMLVideoElement.cpp

Issue 99083002: WIP: Migrate generated bindings to new ExceptionState constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLTextFormControlElement.cpp ('k') | Source/core/html/TimeRanges.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 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 10 matching lines...) Expand all
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 #include "core/html/HTMLVideoElement.h" 27 #include "core/html/HTMLVideoElement.h"
28 28
29 #include "CSSPropertyNames.h" 29 #include "CSSPropertyNames.h"
30 #include "HTMLNames.h" 30 #include "HTMLNames.h"
31 #include "bindings/v8/ExceptionMessages.h"
32 #include "bindings/v8/ExceptionState.h" 31 #include "bindings/v8/ExceptionState.h"
33 #include "core/dom/Attribute.h" 32 #include "core/dom/Attribute.h"
34 #include "core/dom/Document.h" 33 #include "core/dom/Document.h"
35 #include "core/dom/ExceptionCode.h" 34 #include "core/dom/ExceptionCode.h"
36 #include "core/html/HTMLImageLoader.h" 35 #include "core/html/HTMLImageLoader.h"
37 #include "core/html/parser/HTMLParserIdioms.h" 36 #include "core/html/parser/HTMLParserIdioms.h"
38 #include "core/page/Settings.h" 37 #include "core/page/Settings.h"
39 #include "core/rendering/RenderImage.h" 38 #include "core/rendering/RenderImage.h"
40 #include "core/rendering/RenderVideo.h" 39 #include "core/rendering/RenderVideo.h"
41 #include "platform/UserGestureIndicator.h" 40 #include "platform/UserGestureIndicator.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 205 }
207 206
208 void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& exceptionState) 207 void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& exceptionState)
209 { 208 {
210 if (isFullscreen()) 209 if (isFullscreen())
211 return; 210 return;
212 211
213 // Generate an exception if this isn't called in response to a user gesture, or if the 212 // Generate an exception if this isn't called in response to a user gesture, or if the
214 // element does not support fullscreen. 213 // element does not support fullscreen.
215 if (userGestureRequiredForFullscreen() && !UserGestureIndicator::processingU serGesture()) { 214 if (userGestureRequiredForFullscreen() && !UserGestureIndicator::processingU serGesture()) {
216 exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::f ailedToExecute("enterFullscreen", "HTMLVideoElement", "This element may only ent er fullscreen mode in response to a user gesture ('click', for example).")); 215 exceptionState.throwDOMException(InvalidStateError, "This element may on ly enter fullscreen mode in response to a user gesture ('click', for example).") ;
217 return; 216 return;
218 } 217 }
219 if (!supportsFullscreen()) { 218 if (!supportsFullscreen()) {
220 exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::f ailedToExecute("enterFullscreen", "HTMLVideoElement", "This element does not sup port fullscreen mode.")); 219 exceptionState.throwDOMException(InvalidStateError, "This element does n ot support fullscreen mode.");
221 return; 220 return;
222 } 221 }
223 222
224 enterFullscreen(); 223 enterFullscreen();
225 } 224 }
226 225
227 void HTMLVideoElement::webkitExitFullscreen() 226 void HTMLVideoElement::webkitExitFullscreen()
228 { 227 {
229 if (isFullscreen()) 228 if (isFullscreen())
230 exitFullscreen(); 229 exitFullscreen();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 264
266 KURL HTMLVideoElement::posterImageURL() const 265 KURL HTMLVideoElement::posterImageURL() const
267 { 266 {
268 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL()); 267 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL());
269 if (url.isEmpty()) 268 if (url.isEmpty())
270 return KURL(); 269 return KURL();
271 return document().completeURL(url); 270 return document().completeURL(url);
272 } 271 }
273 272
274 } 273 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextFormControlElement.cpp ('k') | Source/core/html/TimeRanges.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698