| 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 // checker size is dynamically adjusted to account for how much the | 392 // checker size is dynamically adjusted to account for how much the |
| 393 // page is currently being scaled. | 393 // page is currently being scaled. |
| 394 scale = frame()->host()->visualViewport().scale(); | 394 scale = frame()->host()->visualViewport().scale(); |
| 395 } else { | 395 } else { |
| 396 // The checker pattern is initialized based on how large the image is | 396 // The checker pattern is initialized based on how large the image is |
| 397 // relative to the viewport. | 397 // relative to the viewport. |
| 398 int viewportWidth = frame()->host()->visualViewport().size().width(); | 398 int viewportWidth = frame()->host()->visualViewport().size().width(); |
| 399 scale = viewportWidth / static_cast<double>(calculateDivWidth()); | 399 scale = viewportWidth / static_cast<double>(calculateDivWidth()); |
| 400 } | 400 } |
| 401 | 401 |
| 402 newCheckerSize = round(std::max(1.0, newCheckerSize / scale)); | 402 newCheckerSize = std::round(std::max(1.0, newCheckerSize / scale)); |
| 403 } else { | 403 } else { |
| 404 // In desktop mode, the user can click on the image to zoom in or out. | 404 // In desktop mode, the user can click on the image to zoom in or out. |
| 405 DCHECK_EQ(m_shrinkToFitMode, Desktop); | 405 DCHECK_EQ(m_shrinkToFitMode, Desktop); |
| 406 if (imageFitsInWindow()) { | 406 if (imageFitsInWindow()) { |
| 407 newCursorMode = Default; | 407 newCursorMode = Default; |
| 408 } else { | 408 } else { |
| 409 newCursorMode = m_shouldShrinkImage ? ZoomIn : ZoomOut; | 409 newCursorMode = m_shouldShrinkImage ? ZoomIn : ZoomOut; |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 | 412 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 } | 603 } |
| 604 | 604 |
| 605 bool ImageEventListener::operator==(const EventListener& listener) const { | 605 bool ImageEventListener::operator==(const EventListener& listener) const { |
| 606 if (const ImageEventListener* imageEventListener = | 606 if (const ImageEventListener* imageEventListener = |
| 607 ImageEventListener::cast(&listener)) | 607 ImageEventListener::cast(&listener)) |
| 608 return m_doc == imageEventListener->m_doc; | 608 return m_doc == imageEventListener->m_doc; |
| 609 return false; | 609 return false; |
| 610 } | 610 } |
| 611 | 611 |
| 612 } // namespace blink | 612 } // namespace blink |
| OLD | NEW |