Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: third_party/WebKit/Source/web/DevToolsEmulator.cpp

Issue 2715243004: [blink] Support (semi-)transparent background colors in WebView/Frame. (Closed)
Patch Set: address comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/frame/VisualViewport.h" 10 #include "core/frame/VisualViewport.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 document->mediaQueryAffectingValueChanged(); 238 document->mediaQueryAffectingValueChanged();
239 } 239 }
240 } 240 }
241 241
242 void DevToolsEmulator::disableDeviceEmulation() { 242 void DevToolsEmulator::disableDeviceEmulation() {
243 if (!m_deviceMetricsEnabled) 243 if (!m_deviceMetricsEnabled)
244 return; 244 return;
245 245
246 memoryCache()->evictResources(); 246 memoryCache()->evictResources();
247 m_deviceMetricsEnabled = false; 247 m_deviceMetricsEnabled = false;
248 m_webViewImpl->setBackgroundColorOverride(Color::transparent); 248 m_webViewImpl->clearBackgroundColorOverride();
249 m_webViewImpl->page()->settings().setDeviceScaleAdjustment( 249 m_webViewImpl->page()->settings().setDeviceScaleAdjustment(
250 m_embedderDeviceScaleAdjustment); 250 m_embedderDeviceScaleAdjustment);
251 disableMobileEmulation(); 251 disableMobileEmulation();
252 m_webViewImpl->setCompositorDeviceScaleFactorOverride(0.f); 252 m_webViewImpl->setCompositorDeviceScaleFactorOverride(0.f);
253 m_webViewImpl->setPageScaleFactor(1.f); 253 m_webViewImpl->setPageScaleFactor(1.f);
254 updateRootLayerTransform(); 254 updateRootLayerTransform();
255 // mainFrameImpl() could be null during cleanup or remote <-> local swap. 255 // mainFrameImpl() could be null during cleanup or remote <-> local swap.
256 if (m_webViewImpl->mainFrameImpl()) { 256 if (m_webViewImpl->mainFrameImpl()) {
257 if (Document* document = 257 if (Document* document =
258 m_webViewImpl->mainFrameImpl()->frame()->document()) 258 m_webViewImpl->mainFrameImpl()->frame()->document())
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 m_lastPinchAnchorCss.reset(); 531 m_lastPinchAnchorCss.reset();
532 m_lastPinchAnchorDip.reset(); 532 m_lastPinchAnchorDip.reset();
533 } 533 }
534 return true; 534 return true;
535 } 535 }
536 536
537 return false; 537 return false;
538 } 538 }
539 539
540 } // namespace blink 540 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698