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

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: add unit test for remote frame transparency Created 3 years, 8 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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698