| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 if (!isDetached()) | 161 if (!isDetached()) |
| 162 document()->imageUpdated(); | 162 document()->imageUpdated(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void ImageDocumentParser::finish() { | 165 void ImageDocumentParser::finish() { |
| 166 if (!isStopped() && document()->imageElement() && | 166 if (!isStopped() && document()->imageElement() && |
| 167 document()->cachedImageResourceDeprecated()) { | 167 document()->cachedImageResourceDeprecated()) { |
| 168 // TODO(hiroshige): Use ImageResourceContent instead of ImageResource. | 168 // TODO(hiroshige): Use ImageResourceContent instead of ImageResource. |
| 169 ImageResource* cachedImage = document()->cachedImageResourceDeprecated(); | 169 ImageResource* cachedImage = document()->cachedImageResourceDeprecated(); |
| 170 DocumentLoader* loader = document()->loader(); | 170 DocumentLoader* loader = document()->loader(); |
| 171 cachedImage->setResponse(loader->response()); | 171 cachedImage->responseReceived(loader->response(), nullptr); |
| 172 cachedImage->finish(loader->timing().responseEnd()); | 172 cachedImage->finish(loader->timing().responseEnd()); |
| 173 | 173 |
| 174 // Report the natural image size in the page title, regardless of zoom | 174 // Report the natural image size in the page title, regardless of zoom |
| 175 // level. At a zoom level of 1 the image is guaranteed to have an integer | 175 // level. At a zoom level of 1 the image is guaranteed to have an integer |
| 176 // size. | 176 // size. |
| 177 IntSize size = flooredIntSize(cachedImageSize(document()->imageElement())); | 177 IntSize size = flooredIntSize(cachedImageSize(document()->imageElement())); |
| 178 if (size.width()) { | 178 if (size.width()) { |
| 179 // Compute the title, we use the decoded filename of the resource, falling | 179 // Compute the title, we use the decoded filename of the resource, falling |
| 180 // back on the (decoded) hostname if there is no path. | 180 // back on the (decoded) hostname if there is no path. |
| 181 String fileName = | 181 String fileName = |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 } | 625 } |
| 626 | 626 |
| 627 bool ImageEventListener::operator==(const EventListener& listener) const { | 627 bool ImageEventListener::operator==(const EventListener& listener) const { |
| 628 if (const ImageEventListener* imageEventListener = | 628 if (const ImageEventListener* imageEventListener = |
| 629 ImageEventListener::cast(&listener)) | 629 ImageEventListener::cast(&listener)) |
| 630 return m_doc == imageEventListener->m_doc; | 630 return m_doc == imageEventListener->m_doc; |
| 631 return false; | 631 return false; |
| 632 } | 632 } |
| 633 | 633 |
| 634 } // namespace blink | 634 } // namespace blink |
| OLD | NEW |