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

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

Issue 24773003: Rename Node::attached() to confusingAndOftenMisusedAttached() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months 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 | Annotate | Revision Log
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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 timeline->setAttribute(precisionAttr, "float"); 478 timeline->setAttribute(precisionAttr, "float");
479 return timeline.release(); 479 return timeline.release();
480 } 480 }
481 481
482 void MediaControlTimelineElement::defaultEventHandler(Event* event) 482 void MediaControlTimelineElement::defaultEventHandler(Event* event)
483 { 483 {
484 // Left button is 0. Rejects mouse events not from left button. 484 // Left button is 0. Rejects mouse events not from left button.
485 if (event->isMouseEvent() && toMouseEvent(event)->button()) 485 if (event->isMouseEvent() && toMouseEvent(event)->button())
486 return; 486 return;
487 487
488 if (!attached()) 488 if (!confusingAndOftenMisusedAttached())
489 return; 489 return;
490 490
491 if (event->type() == eventNames().mousedownEvent) 491 if (event->type() == eventNames().mousedownEvent)
492 mediaController()->beginScrubbing(); 492 mediaController()->beginScrubbing();
493 493
494 if (event->type() == eventNames().mouseupEvent) 494 if (event->type() == eventNames().mouseupEvent)
495 mediaController()->endScrubbing(); 495 mediaController()->endScrubbing();
496 496
497 MediaControlInputElement::defaultEventHandler(event); 497 MediaControlInputElement::defaultEventHandler(event);
498 498
499 if (event->type() == eventNames().mouseoverEvent || event->type() == eventNa mes().mouseoutEvent || event->type() == eventNames().mousemoveEvent) 499 if (event->type() == eventNames().mouseoverEvent || event->type() == eventNa mes().mouseoutEvent || event->type() == eventNames().mousemoveEvent)
500 return; 500 return;
501 501
502 double time = value().toDouble(); 502 double time = value().toDouble();
503 if (event->type() == eventNames().inputEvent && time != mediaController()->c urrentTime()) 503 if (event->type() == eventNames().inputEvent && time != mediaController()->c urrentTime())
504 mediaController()->setCurrentTime(time, IGNORE_EXCEPTION); 504 mediaController()->setCurrentTime(time, IGNORE_EXCEPTION);
505 505
506 RenderSlider* slider = toRenderSlider(renderer()); 506 RenderSlider* slider = toRenderSlider(renderer());
507 if (slider && slider->inDragMode()) 507 if (slider && slider->inDragMode())
508 m_controls->updateCurrentTimeDisplay(); 508 m_controls->updateCurrentTimeDisplay();
509 } 509 }
510 510
511 bool MediaControlTimelineElement::willRespondToMouseClickEvents() 511 bool MediaControlTimelineElement::willRespondToMouseClickEvents()
512 { 512 {
513 if (!attached()) 513 if (!confusingAndOftenMisusedAttached())
514 return false; 514 return false;
515 515
516 return true; 516 return true;
517 } 517 }
518 518
519 void MediaControlTimelineElement::setPosition(double currentTime) 519 void MediaControlTimelineElement::setPosition(double currentTime)
520 { 520 {
521 setValue(String::number(currentTime)); 521 setValue(String::number(currentTime));
522 } 522 }
523 523
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 CueList activeCues = mediaElement->currentlyActiveCues(); 805 CueList activeCues = mediaElement->currentlyActiveCues();
806 for (size_t i = 0; i < activeCues.size(); ++i) { 806 for (size_t i = 0; i < activeCues.size(); ++i) {
807 TextTrackCue* cue = activeCues[i].data(); 807 TextTrackCue* cue = activeCues[i].data();
808 cue->videoSizeDidChange(m_videoDisplaySize.size()); 808 cue->videoSizeDidChange(m_videoDisplaySize.size());
809 } 809 }
810 } 810 }
811 811
812 // ---------------------------- 812 // ----------------------------
813 813
814 } // namespace WebCore 814 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/shadow/MediaControlElementTypes.cpp ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698