Simplify the check for web_frame_widget
This commit is contained in:
parent
e8c4fb6903
commit
35d9e37220
1 changed files with 9 additions and 10 deletions
|
@ -141,24 +141,23 @@ void AtomRendererClient::RenderFrameCreated(
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomRendererClient::RenderViewCreated(content::RenderView* render_view) {
|
void AtomRendererClient::RenderViewCreated(content::RenderView* render_view) {
|
||||||
base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
|
new printing::PrintWebViewHelper(render_view);
|
||||||
|
new AtomRenderViewObserver(render_view, this);
|
||||||
|
|
||||||
blink::WebFrameWidget* web_frame_widget = render_view->GetWebFrameWidget();
|
blink::WebFrameWidget* web_frame_widget = render_view->GetWebFrameWidget();
|
||||||
|
if (!web_frame_widget)
|
||||||
|
return;
|
||||||
|
|
||||||
|
base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
|
||||||
if (cmd->HasSwitch(switches::kGuestInstanceID)) { // webview.
|
if (cmd->HasSwitch(switches::kGuestInstanceID)) { // webview.
|
||||||
if (web_frame_widget) {
|
web_frame_widget->setBaseBackgroundColor(SK_ColorTRANSPARENT);
|
||||||
web_frame_widget->setBaseBackgroundColor(SK_ColorTRANSPARENT);
|
|
||||||
}
|
|
||||||
} else { // normal window.
|
} else { // normal window.
|
||||||
// If backgroundColor is specified then use it.
|
// If backgroundColor is specified then use it.
|
||||||
std::string name = cmd->GetSwitchValueASCII(switches::kBackgroundColor);
|
std::string name = cmd->GetSwitchValueASCII(switches::kBackgroundColor);
|
||||||
// Otherwise use white background.
|
// Otherwise use white background.
|
||||||
SkColor color = name.empty() ? SK_ColorWHITE : ParseHexColor(name);
|
SkColor color = name.empty() ? SK_ColorWHITE : ParseHexColor(name);
|
||||||
if (web_frame_widget) {
|
web_frame_widget->setBaseBackgroundColor(color);
|
||||||
web_frame_widget->setBaseBackgroundColor(color);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
new printing::PrintWebViewHelper(render_view);
|
|
||||||
new AtomRenderViewObserver(render_view, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blink::WebSpeechSynthesizer* AtomRendererClient::OverrideSpeechSynthesizer(
|
blink::WebSpeechSynthesizer* AtomRendererClient::OverrideSpeechSynthesizer(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue