| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 void PinchViewport::setScaleAndLocation(float scale, const FloatPoint& location) | 191 void PinchViewport::setScaleAndLocation(float scale, const FloatPoint& location) |
| 192 { | 192 { |
| 193 bool valuesChanged = false; | 193 bool valuesChanged = false; |
| 194 | 194 |
| 195 if (scale != m_scale) { | 195 if (scale != m_scale) { |
| 196 m_scale = scale; | 196 m_scale = scale; |
| 197 valuesChanged = true; | 197 valuesChanged = true; |
| 198 frameHost().chrome().client().pageScaleFactorChanged(); | 198 frameHost().chrome().client().pageScaleFactorChanged(); |
| 199 } | 199 } |
| 200 | 200 |
| 201 // Old-style pinch sets scale here but we shouldn't call into the | |
| 202 // location code below. Can be removed when there's no old-style pinch. | |
| 203 // FIXME(bokan): Remove when cleaning up old pinch code. | |
| 204 if (!m_innerViewportScrollLayer) { | |
| 205 if (valuesChanged) | |
| 206 mainFrame()->loader().saveScrollState(); | |
| 207 | |
| 208 return; | |
| 209 } | |
| 210 | |
| 211 FloatPoint clampedOffset(clampOffsetToBoundaries(location)); | 201 FloatPoint clampedOffset(clampOffsetToBoundaries(location)); |
| 212 | 202 |
| 213 if (clampedOffset != m_offset) { | 203 if (clampedOffset != m_offset) { |
| 214 m_offset = clampedOffset; | 204 m_offset = clampedOffset; |
| 215 scrollAnimator()->setCurrentPosition(m_offset); | 205 scrollAnimator()->setCurrentPosition(m_offset); |
| 216 | 206 |
| 217 ScrollingCoordinator* coordinator = frameHost().page().scrollingCoordina
tor(); | 207 // SVG runs with accelerated compositing disabled so no ScrollingCoordin
ator. |
| 218 ASSERT(coordinator); | 208 if (ScrollingCoordinator* coordinator = frameHost().page().scrollingCoor
dinator()) |
| 219 coordinator->scrollableAreaScrollLayerDidChange(this); | 209 coordinator->scrollableAreaScrollLayerDidChange(this); |
| 220 | 210 |
| 221 Document* document = mainFrame()->document(); | 211 Document* document = mainFrame()->document(); |
| 222 document->enqueueScrollEventForNode(document); | 212 document->enqueueScrollEventForNode(document); |
| 223 | 213 |
| 224 mainFrame()->loader().client()->didChangeScrollOffset(); | 214 mainFrame()->loader().client()->didChangeScrollOffset(); |
| 225 InspectorInstrumentation::didScroll(mainFrame()); | 215 InspectorInstrumentation::didScroll(mainFrame()); |
| 226 valuesChanged = true; | 216 valuesChanged = true; |
| 227 } | 217 } |
| 228 | 218 |
| 229 if (!valuesChanged) | 219 if (!valuesChanged) |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 } else if (graphicsLayer == m_rootTransformLayer) { | 654 } else if (graphicsLayer == m_rootTransformLayer) { |
| 665 name = "Root Transform Layer"; | 655 name = "Root Transform Layer"; |
| 666 } else { | 656 } else { |
| 667 ASSERT_NOT_REACHED(); | 657 ASSERT_NOT_REACHED(); |
| 668 } | 658 } |
| 669 | 659 |
| 670 return name; | 660 return name; |
| 671 } | 661 } |
| 672 | 662 |
| 673 } // namespace blink | 663 } // namespace blink |
| OLD | NEW |