Index: chrome/browser/ui/views/extensions/shell_window_views.cc |
diff --git a/chrome/browser/ui/views/extensions/shell_window_views.cc b/chrome/browser/ui/views/extensions/shell_window_views.cc |
index 02199e94fabc0bbf46634c90493fd009ce41036c..970d99705a66cc8426f26e435c5eb9940f8a8e1b 100644 |
--- a/chrome/browser/ui/views/extensions/shell_window_views.cc |
+++ b/chrome/browser/ui/views/extensions/shell_window_views.cc |
@@ -319,7 +319,9 @@ ShellWindowViews::ShellWindowViews(ShellWindow* shell_window, |
: shell_window_(shell_window), |
web_view_(NULL), |
is_fullscreen_(false), |
- frameless_(win_params.frame == ShellWindow::CreateParams::FRAME_NONE) { |
+ frameless_(win_params.frame == ShellWindow::CreateParams::FRAME_NONE), |
+ transparent_background_(win_params.transparent_background) { |
+ Observe(shell_window_->web_contents()); |
window_ = new views::Widget; |
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
params.delegate = this; |
@@ -605,6 +607,21 @@ bool ShellWindowViews::ShouldShowWindowTitle() const { |
return false; |
} |
+void ShellWindowViews::RenderViewCreated( |
+ content::RenderViewHost* render_view_host) { |
+ if (transparent_background_) { |
sky
2012/09/28 22:29:13
Does this result in flicker? Might it be possible
Bernie
2012/10/10 21:05:01
The window opens with a white background, then it
reveman
2012/10/11 17:25:58
We'll need to fix this. But I think it's OK to add
|
+ // Use a background with transparency to trigger transparency in Webkit. |
+ SkBitmap background; |
+ background.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); |
+ background.allocPixels(); |
+ background.eraseARGB(0x00, 0x00, 0x00, 0x00); |
+ |
+ content::RenderWidgetHostView* view = render_view_host->GetView(); |
+ DCHECK(view); |
+ view->SetBackground(background); |
+ } |
+} |
+ |
void ShellWindowViews::Layout() { |
DCHECK(web_view_); |
web_view_->SetBounds(0, 0, width(), height()); |