diff --git a/src/browser/native_window_win.cc b/src/browser/native_window_win.cc index 2503cf8091..fa91c766b7 100644 --- a/src/browser/native_window_win.cc +++ b/src/browser/native_window_win.cc @@ -42,6 +42,7 @@ #include "ui/views/widget/widget.h" #include "ui/views/widget/native_widget_win.h" #include "ui/views/window/native_frame_view.h" +#include namespace nw { @@ -242,6 +243,11 @@ NativeWindowWin::NativeWindowWin(content::Shell* shell, maximum_size_() { window_ = new views::Widget; views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); + + bool transparent; + if(manifest->GetBoolean(switches::kmTransparent, &transparent) && transparent) + params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; + params.delegate = this; params.remove_standard_frame = !has_frame(); params.use_system_default_icon = true; @@ -261,6 +267,11 @@ NativeWindowWin::NativeWindowWin(content::Shell* shell, window_->UpdateWindowIcon(); OnViewWasResized(); + + if(transparent) { + MARGINS mgMarInset = { -1, -1, -1, -1 }; + DwmExtendFrameIntoClientArea(window_->GetNativeWindow(), &mgMarInset); + } } NativeWindowWin::~NativeWindowWin() { diff --git a/src/nw_shell.cc b/src/nw_shell.cc index 485008771f..105fe3dd5c 100644 --- a/src/nw_shell.cc +++ b/src/nw_shell.cc @@ -374,9 +374,7 @@ void Shell::WebContentsCreated(WebContents* source_contents, manifest->SetBoolean(switches::kmResizable, features.resizable); manifest->SetBoolean(switches::kmFullscreen, features.fullscreen); - manifest->SetBoolean(switches::kmTransparent, features.transparent); - manifest->SetBoolean(switches::kmFrame, features.frame); - manifest->SetBoolean(switches::kmShadow, features.shadow); + if (features.widthSet) manifest->SetInteger(switches::kmWidth, features.width); if (features.heightSet) diff --git a/src/shell_content_browser_client.cc b/src/shell_content_browser_client.cc index ef3bc352c9..0b89b21c17 100644 --- a/src/shell_content_browser_client.cc +++ b/src/shell_content_browser_client.cc @@ -166,6 +166,12 @@ void ShellContentBrowserClient::OverrideWebkitPrefs( // Force compositing mode to support transparency prefs->force_compositing_mode = true; + prefs->accelerated_2d_canvas_enabled = true; + prefs->accelerated_animation_enabled = true; + prefs->accelerated_compositing_enabled = true; + prefs->accelerated_filters_enabled = true; + prefs->accelerated_layers_enabled = true; + prefs->accelerated_painting_enabled = true; base::DictionaryValue* webkit; if (package->root()->GetDictionary(switches::kmWebkit, &webkit)) {