Set the backgroundColor of RenderWidgetHostView

This commit is contained in:
Cheng Zhao 2016-04-14 21:52:17 +09:00
parent 7501a02b34
commit b84a178ceb
2 changed files with 19 additions and 6 deletions

View file

@ -807,9 +807,14 @@ bool NativeWindowMac::IsKiosk() {
}
void NativeWindowMac::SetBackgroundColor(const std::string& color_name) {
base::ScopedCFTypeRef<CGColorRef> color =
skia::CGColorCreateFromSkColor(ParseHexColor(color_name));
[[[window_ contentView] layer] setBackgroundColor:color];
SkColor color = ParseHexColor(color_name);
base::ScopedCFTypeRef<CGColorRef> cgcolor =
skia::CGColorCreateFromSkColor(color);
[[[window_ contentView] layer] setBackgroundColor:cgcolor];
const auto view = web_contents()->GetRenderWidgetHostView();
if (view)
view->SetBackgroundColor(color);
}
void NativeWindowMac::SetHasShadow(bool has_shadow) {