Support transparent window in Views framework (follow up issue #2315) #4086
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a PR of the work by Andy Tzeng:
https://bitbucket.org/chromiumembedded/cef/pull-requests/267/overview
Andy's over is copied below:
What I need is very similar to the issue #2315. I would like to provide my changes for the case.
First of all, the requirement I have is to create a non-rectangular window. One solution is implementing OSR to have parent window with transparent background. Another solution is creating a translucent window via Views frameworks, which is what this PR did.
The major changes are:
Configure opacity to views::Widget::InitParams::WindowOpacity::kTranslucent while initializing the Widget controlled by the alpha component of CefBrowserSettings.background_color
Set the background color of CefWindow to transparent if above is configured
Invoke CefContext::Get()->GetBackgroundColor() with STATE_ENABLED from Views framework invocation chain to enable transparent capability.
I created a testing page using the Views framework as below:

The page can be launched by
cefclient --use-views --transparent-painting-enabled --hide-frame --hide-controls --hide-overlaysThank you for any feedback/comments in advance.