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

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

Issue 2715243004: [blink] Support (semi-)transparent background colors in WebView/Frame. (Closed)
Patch Set: remove set/isTransparent from WebViewImpl and FrameView, use setBaseBackgroundColor instead 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 #include "core/timing/DOMWindowPerformance.h" 159 #include "core/timing/DOMWindowPerformance.h"
160 #include "core/timing/Performance.h" 160 #include "core/timing/Performance.h"
161 #include "modules/app_banner/AppBannerController.h" 161 #include "modules/app_banner/AppBannerController.h"
162 #include "modules/installation/InstallationServiceImpl.h" 162 #include "modules/installation/InstallationServiceImpl.h"
163 #include "modules/screen_orientation/ScreenOrientationControllerImpl.h" 163 #include "modules/screen_orientation/ScreenOrientationControllerImpl.h"
164 #include "platform/ScriptForbiddenScope.h" 164 #include "platform/ScriptForbiddenScope.h"
165 #include "platform/UserGestureIndicator.h" 165 #include "platform/UserGestureIndicator.h"
166 #include "platform/WebFrameScheduler.h" 166 #include "platform/WebFrameScheduler.h"
167 #include "platform/clipboard/ClipboardUtilities.h" 167 #include "platform/clipboard/ClipboardUtilities.h"
168 #include "platform/fonts/FontCache.h" 168 #include "platform/fonts/FontCache.h"
169 #include "platform/graphics/Color.h"
169 #include "platform/graphics/GraphicsContext.h" 170 #include "platform/graphics/GraphicsContext.h"
170 #include "platform/graphics/GraphicsLayerClient.h" 171 #include "platform/graphics/GraphicsLayerClient.h"
171 #include "platform/graphics/paint/ClipRecorder.h" 172 #include "platform/graphics/paint/ClipRecorder.h"
172 #include "platform/graphics/paint/DisplayItemCacheSkipper.h" 173 #include "platform/graphics/paint/DisplayItemCacheSkipper.h"
173 #include "platform/graphics/paint/DrawingRecorder.h" 174 #include "platform/graphics/paint/DrawingRecorder.h"
174 #include "platform/graphics/paint/PaintRecordBuilder.h" 175 #include "platform/graphics/paint/PaintRecordBuilder.h"
175 #include "platform/graphics/skia/SkiaUtils.h" 176 #include "platform/graphics/skia/SkiaUtils.h"
176 #include "platform/heap/Handle.h" 177 #include "platform/heap/Handle.h"
177 #include "platform/instrumentation/tracing/TraceEvent.h" 178 #include "platform/instrumentation/tracing/TraceEvent.h"
178 #include "platform/loader/fetch/ResourceFetcher.h" 179 #include "platform/loader/fetch/ResourceFetcher.h"
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1719 WebViewImpl* webView = viewImpl(); 1720 WebViewImpl* webView = viewImpl();
1720 1721
1721 // Check if we're shutting down. 1722 // Check if we're shutting down.
1722 if (!webView->page()) 1723 if (!webView->page())
1723 return; 1724 return;
1724 1725
1725 bool isMainFrame = !parent(); 1726 bool isMainFrame = !parent();
1726 IntSize initialSize = (isMainFrame || !frameWidget()) 1727 IntSize initialSize = (isMainFrame || !frameWidget())
1727 ? webView->mainFrameSize() 1728 ? webView->mainFrameSize()
1728 : (IntSize)frameWidget()->size(); 1729 : (IntSize)frameWidget()->size();
1729 bool isTransparent = !isMainFrame && parent()->isWebRemoteFrame() 1730 Color baseBackgroundColor = webView->baseBackgroundColor();
1730 ? true 1731 if (!isMainFrame && parent()->isWebRemoteFrame()) {
lfg 2017/03/23 16:05:21 nit: no need for {}
Eric Seckler 2017/03/23 16:34:49 Done.
1731 : webView->isTransparent(); 1732 baseBackgroundColor = Color::transparent;
1733 }
1732 1734
1733 frame()->createView(initialSize, webView->baseBackgroundColor(), 1735 frame()->createView(initialSize, webView->baseBackgroundColor());
1734 isTransparent);
1735 if (isMainFrame) { 1736 if (isMainFrame) {
1736 frame()->view()->setInitialViewportSize( 1737 frame()->view()->setInitialViewportSize(
1737 webView->pageScaleConstraintsSet().initialViewportSize()); 1738 webView->pageScaleConstraintsSet().initialViewportSize());
1738 } 1739 }
1739 if (webView->shouldAutoResize() && frame()->isLocalRoot()) 1740 if (webView->shouldAutoResize() && frame()->isLocalRoot())
1740 frame()->view()->enableAutoSizeMode(webView->minAutoSize(), 1741 frame()->view()->enableAutoSizeMode(webView->minAutoSize(),
1741 webView->maxAutoSize()); 1742 webView->maxAutoSize());
1742 1743
1743 frame()->view()->setInputEventsTransformForEmulation( 1744 frame()->view()->setInputEventsTransformForEmulation(
1744 m_inputEventsOffsetForEmulation, m_inputEventsScaleFactorForEmulation); 1745 m_inputEventsOffsetForEmulation, m_inputEventsScaleFactorForEmulation);
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
2516 createMarkup(startPosition, endPosition, AnnotateForInterchange, 2517 createMarkup(startPosition, endPosition, AnnotateForInterchange,
2517 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2518 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2518 } else { 2519 } else {
2519 clipHtml = 2520 clipHtml =
2520 createMarkup(endPosition, startPosition, AnnotateForInterchange, 2521 createMarkup(endPosition, startPosition, AnnotateForInterchange,
2521 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2522 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2522 } 2523 }
2523 } 2524 }
2524 2525
2525 } // namespace blink 2526 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698