| OLD | NEW |
| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 if (child->node()->isTextTrackContainer()) | 112 if (child->node()->isTextTrackContainer()) |
| 113 return true; | 113 return true; |
| 114 | 114 |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void LayoutMedia::paintReplaced(const PaintInfo&, const LayoutPoint&) const | 118 void LayoutMedia::paintReplaced(const PaintInfo&, const LayoutPoint&) const |
| 119 { | 119 { |
| 120 } | 120 } |
| 121 | 121 |
| 122 void LayoutMedia::willBeDestroyed() |
| 123 { |
| 124 if (view()) |
| 125 view()->unregisterMediaForPositionChangeNotification(*this); |
| 126 LayoutImage::willBeDestroyed(); |
| 127 } |
| 128 |
| 129 void LayoutMedia::insertedIntoTree() |
| 130 { |
| 131 LayoutImage::insertedIntoTree(); |
| 132 |
| 133 // Note that if we don't want them and aren't registered, then this |
| 134 // will do nothing. |
| 135 if (HTMLMediaElement* element = mediaElement()) |
| 136 element->updatePositionNotificationRegistration(); |
| 137 } |
| 138 |
| 139 void LayoutMedia::notifyPositionMayHaveChanged(const IntRect& visibleRect) |
| 140 { |
| 141 // Tell our element about it. |
| 142 if (HTMLMediaElement* element = mediaElement()) |
| 143 element->notifyPositionMayHaveChanged(visibleRect); |
| 144 } |
| 145 |
| 146 void LayoutMedia::setRequestPositionUpdates(bool want) |
| 147 { |
| 148 if (want) |
| 149 view()->registerMediaForPositionChangeNotification(*this); |
| 150 else |
| 151 view()->unregisterMediaForPositionChangeNotification(*this); |
| 152 } |
| 153 |
| 122 } // namespace blink | 154 } // namespace blink |
| OLD | NEW |