Remove NativeWindow::FromWebContents

This commit is contained in:
Cheng Zhao 2018-03-06 15:18:45 +09:00
parent eea4e60b73
commit 702f1631a3
4 changed files with 11 additions and 19 deletions

View file

@ -209,11 +209,14 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
if (manager) {
auto embedder = manager->GetEmbedder(guest_instance_id);
if (embedder) {
auto window = NativeWindow::FromWebContents(embedder);
if (window) {
const bool visible = window->IsVisible() && !window->IsMinimized();
if (!visible) {
command_line->AppendSwitch(switches::kHiddenPage);
auto* relay = NativeWindowRelay::FromWebContents(web_contents);
if (relay) {
auto* window = relay->window.get();
if (window) {
const bool visible = window->IsVisible() && !window->IsMinimized();
if (!visible) {
command_line->AppendSwitch(switches::kHiddenPage);
}
}
}
}