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

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp

Issue 1415683009: Support earliest seekable time in WMPI. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more androidfixes. Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 if (event->type() == EventTypeNames::mouseup) 401 if (event->type() == EventTypeNames::mouseup)
402 mediaControls().endScrubbing(); 402 mediaControls().endScrubbing();
403 403
404 MediaControlInputElement::defaultEventHandler(event); 404 MediaControlInputElement::defaultEventHandler(event);
405 405
406 if (event->type() == EventTypeNames::mouseover || event->type() == EventType Names::mouseout || event->type() == EventTypeNames::mousemove) 406 if (event->type() == EventTypeNames::mouseover || event->type() == EventType Names::mouseout || event->type() == EventTypeNames::mousemove)
407 return; 407 return;
408 408
409 double time = value().toDouble(); 409 double time = value().toDouble();
410 if (event->type() == EventTypeNames::input) { 410 if (event->type() == EventTypeNames::input) {
411 // FIXME: This will need to take the timeline offset into consideration
412 // once that concept is supported, see https://crbug.com/312699
413 if (mediaElement().seekable()->contain(time)) 411 if (mediaElement().seekable()->contain(time))
414 mediaElement().setCurrentTime(time); 412 mediaElement().setCurrentTime(time);
415 } 413 }
416 414
417 LayoutSlider* slider = toLayoutSlider(layoutObject()); 415 LayoutSlider* slider = toLayoutSlider(layoutObject());
418 if (slider && slider->inDragMode()) 416 if (slider && slider->inDragMode())
419 mediaControls().updateCurrentTimeDisplay(); 417 mediaControls().updateCurrentTimeDisplay();
420 } 418 }
421 419
422 bool MediaControlTimelineElement::willRespondToMouseClickEvents() 420 bool MediaControlTimelineElement::willRespondToMouseClickEvents()
423 { 421 {
424 return inDocument() && document().isActive(); 422 return inDocument() && document().isActive();
425 } 423 }
426 424
425 void MediaControlTimelineElement::setEarliestPosition(double earliestTime)
426 {
427 setFloatingPointAttribute(minAttr, earliestTime);
428 }
429
427 void MediaControlTimelineElement::setPosition(double currentTime) 430 void MediaControlTimelineElement::setPosition(double currentTime)
428 { 431 {
429 setValue(String::number(currentTime)); 432 setValue(String::number(currentTime));
430 433
431 if (LayoutObject* layoutObject = this->layoutObject()) 434 if (LayoutObject* layoutObject = this->layoutObject())
432 layoutObject->setShouldDoFullPaintInvalidation(); 435 layoutObject->setShouldDoFullPaintInvalidation();
433 } 436 }
434 437
435 void MediaControlTimelineElement::setDuration(double duration) 438 void MediaControlTimelineElement::setDuration(double duration)
436 { 439 {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 } 653 }
651 654
652 PassRefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> MediaControlCurren tTimeDisplayElement::create(MediaControls& mediaControls) 655 PassRefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> MediaControlCurren tTimeDisplayElement::create(MediaControls& mediaControls)
653 { 656 {
654 RefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> element = adoptRef WillBeNoop(new MediaControlCurrentTimeDisplayElement(mediaControls)); 657 RefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> element = adoptRef WillBeNoop(new MediaControlCurrentTimeDisplayElement(mediaControls));
655 element->setShadowPseudoId(AtomicString("-webkit-media-controls-current-time -display", AtomicString::ConstructFromLiteral)); 658 element->setShadowPseudoId(AtomicString("-webkit-media-controls-current-time -display", AtomicString::ConstructFromLiteral));
656 return element.release(); 659 return element.release();
657 } 660 }
658 661
659 } // namespace blink 662 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698