| 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/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/frame/VisualViewport.h" | 9 #include "core/frame/VisualViewport.h" |
| 10 #include "core/input/EventHandler.h" | 10 #include "core/input/EventHandler.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 document->mediaQueryAffectingValueChanged(); | 237 document->mediaQueryAffectingValueChanged(); |
| 238 } | 238 } |
| 239 } | 239 } |
| 240 | 240 |
| 241 void DevToolsEmulator::disableDeviceEmulation() { | 241 void DevToolsEmulator::disableDeviceEmulation() { |
| 242 if (!m_deviceMetricsEnabled) | 242 if (!m_deviceMetricsEnabled) |
| 243 return; | 243 return; |
| 244 | 244 |
| 245 memoryCache()->evictResources(); | 245 memoryCache()->evictResources(); |
| 246 m_deviceMetricsEnabled = false; | 246 m_deviceMetricsEnabled = false; |
| 247 m_webViewImpl->setBackgroundColorOverride(Color::transparent); | 247 m_webViewImpl->clearBackgroundColorOverride(); |
| 248 m_webViewImpl->page()->settings().setDeviceScaleAdjustment( | 248 m_webViewImpl->page()->settings().setDeviceScaleAdjustment( |
| 249 m_embedderDeviceScaleAdjustment); | 249 m_embedderDeviceScaleAdjustment); |
| 250 disableMobileEmulation(); | 250 disableMobileEmulation(); |
| 251 m_webViewImpl->setCompositorDeviceScaleFactorOverride(0.f); | 251 m_webViewImpl->setCompositorDeviceScaleFactorOverride(0.f); |
| 252 m_webViewImpl->setPageScaleFactor(1.f); | 252 m_webViewImpl->setPageScaleFactor(1.f); |
| 253 updateRootLayerTransform(); | 253 updateRootLayerTransform(); |
| 254 // mainFrameImpl() could be null during cleanup or remote <-> local swap. | 254 // mainFrameImpl() could be null during cleanup or remote <-> local swap. |
| 255 if (m_webViewImpl->mainFrameImpl()) { | 255 if (m_webViewImpl->mainFrameImpl()) { |
| 256 if (Document* document = | 256 if (Document* document = |
| 257 m_webViewImpl->mainFrameImpl()->frame()->document()) | 257 m_webViewImpl->mainFrameImpl()->frame()->document()) |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 m_lastPinchAnchorCss.reset(); | 530 m_lastPinchAnchorCss.reset(); |
| 531 m_lastPinchAnchorDip.reset(); | 531 m_lastPinchAnchorDip.reset(); |
| 532 } | 532 } |
| 533 return true; | 533 return true; |
| 534 } | 534 } |
| 535 | 535 |
| 536 return false; | 536 return false; |
| 537 } | 537 } |
| 538 | 538 |
| 539 } // namespace blink | 539 } // namespace blink |
| OLD | NEW |