I'm trying to change the content shell background as transparent by using below code,
diff --git a/content/shell/browser/shell_aura.cc b/content/shell/browser/shell_aura.cc
index 4719a15..d20aba0 100644
--- a/content/shell/browser/shell_aura.cc
+++ b/content/shell/browser/shell_aura.cc
@@ -4,6 +4,7 @@
#include "content/shell/browser/shell.h"
+#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/shell/browser/shell_platform_data_aura.h"
@@ -39,6 +40,18 @@ void Shell::PlatformSetAddressBarURL(const GURL& url) {
}
void Shell::PlatformSetIsLoading(bool loading) {
+ // To set background as transparent
+ RenderWidgetHostView* render_widget_host_view = web_contents_?
+ web_contents_->GetRenderWidgetHostView():0;
+ LOG(INFO)<<"RenderWidgetHostView:"<<render_widget_host_view<<", WebContents:"<<web_contents_.get();
+ if (render_widget_host_view) {
+ SkBitmap skBitmap;
+ skBitmap.setConfig(SkBitmap::kARGB_8888_Config, 1, 1);
+ skBitmap.allocPixels();
+ skBitmap.eraseColor(0);
+ render_widget_host_view->SetBackground(skBitmap);
+ LOG(INFO)<<"Setting transparent background";
+ }
}