OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 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 2637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2648 return; | 2648 return; |
2649 | 2649 |
2650 Settings* settings = document()->settings(); | 2650 Settings* settings = document()->settings(); |
2651 bool privateMode = !settings || settings->privateBrowsingEnabled(); | 2651 bool privateMode = !settings || settings->privateBrowsingEnabled(); |
2652 LOG(Media, "HTMLMediaElement::privateBrowsingStateDidChange(%s)", boolString
(privateMode)); | 2652 LOG(Media, "HTMLMediaElement::privateBrowsingStateDidChange(%s)", boolString
(privateMode)); |
2653 m_player->setPrivateBrowsingMode(privateMode); | 2653 m_player->setPrivateBrowsingMode(privateMode); |
2654 } | 2654 } |
2655 | 2655 |
2656 MediaControls* HTMLMediaElement::mediaControls() | 2656 MediaControls* HTMLMediaElement::mediaControls() |
2657 { | 2657 { |
2658 if (!shadowRoot()) | 2658 return toMediaControls(shadowRoot()->firstChild()); |
2659 return 0; | |
2660 | |
2661 Node* node = shadowRoot()->firstChild(); | |
2662 ASSERT(node->isHTMLElement()); | |
2663 return static_cast<MediaControls*>(node); | |
2664 } | 2659 } |
2665 | 2660 |
2666 bool HTMLMediaElement::hasMediaControls() | 2661 bool HTMLMediaElement::hasMediaControls() |
2667 { | 2662 { |
2668 return shadowRoot(); | 2663 if (!shadowRoot()) |
| 2664 return false; |
| 2665 |
| 2666 Node* node = shadowRoot()->firstChild(); |
| 2667 return node && node->isMediaControls(); |
2669 } | 2668 } |
2670 | 2669 |
2671 void HTMLMediaElement::ensureMediaControls() | 2670 void HTMLMediaElement::ensureMediaControls() |
2672 { | 2671 { |
2673 if (hasMediaControls()) | 2672 if (hasMediaControls()) |
2674 return; | 2673 return; |
2675 | 2674 |
2676 ExceptionCode ec; | 2675 ExceptionCode ec; |
2677 ensureShadowRoot()->appendChild(MediaControls::create(this), ec); | 2676 ensureShadowRoot()->appendChild(MediaControls::create(this), ec); |
2678 } | 2677 } |
(...skipping 10 matching lines...) Expand all Loading... |
2689 } else if (hasMediaControls()) | 2688 } else if (hasMediaControls()) |
2690 mediaControls()->hide(); | 2689 mediaControls()->hide(); |
2691 } | 2690 } |
2692 return 0; | 2691 return 0; |
2693 } | 2692 } |
2694 | 2693 |
2695 | 2694 |
2696 } | 2695 } |
2697 | 2696 |
2698 #endif | 2697 #endif |
OLD | NEW |