| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "web/DevToolsEmulator.h" | 5 #include "web/DevToolsEmulator.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameHost.h" | 7 #include "core/frame/FrameHost.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/page/Page.h" | 10 #include "core/page/Page.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 m_lastPinchAnchorDip->scale(pageScaleFactor, pageScaleFactor); | 370 m_lastPinchAnchorDip->scale(pageScaleFactor, pageScaleFactor); |
| 371 } | 371 } |
| 372 if (gestureEvent.type() == PlatformEvent::GesturePinchUpdate && m_lastPi
nchAnchorCss) { | 372 if (gestureEvent.type() == PlatformEvent::GesturePinchUpdate && m_lastPi
nchAnchorCss) { |
| 373 float newPageScaleFactor = pageScaleFactor * gestureEvent.scale(); | 373 float newPageScaleFactor = pageScaleFactor * gestureEvent.scale(); |
| 374 IntPoint anchorCss(*m_lastPinchAnchorDip.get()); | 374 IntPoint anchorCss(*m_lastPinchAnchorDip.get()); |
| 375 anchorCss.scale(1.f / newPageScaleFactor, 1.f / newPageScaleFactor); | 375 anchorCss.scale(1.f / newPageScaleFactor, 1.f / newPageScaleFactor); |
| 376 m_webViewImpl->setPageScaleFactor(newPageScaleFactor); | 376 m_webViewImpl->setPageScaleFactor(newPageScaleFactor); |
| 377 m_webViewImpl->mainFrame()->setScrollOffset(toIntSize(*m_lastPinchAn
chorCss.get() - toIntSize(anchorCss))); | 377 m_webViewImpl->mainFrame()->setScrollOffset(toIntSize(*m_lastPinchAn
chorCss.get() - toIntSize(anchorCss))); |
| 378 } | 378 } |
| 379 if (gestureEvent.type() == PlatformEvent::GesturePinchEnd) { | 379 if (gestureEvent.type() == PlatformEvent::GesturePinchEnd) { |
| 380 m_lastPinchAnchorCss.clear(); | 380 m_lastPinchAnchorCss.reset(); |
| 381 m_lastPinchAnchorDip.clear(); | 381 m_lastPinchAnchorDip.reset(); |
| 382 } | 382 } |
| 383 return true; | 383 return true; |
| 384 } | 384 } |
| 385 | 385 |
| 386 return false; | 386 return false; |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace blink | 389 } // namespace blink |
| OLD | NEW |