Support document visiblity state and events in webviews

This commit is contained in:
Kevin Sawicki 2016-05-24 12:44:09 -07:00
parent 1e15ce6ccd
commit 73b07f76a3
6 changed files with 25 additions and 4 deletions

View file

@ -160,7 +160,14 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
if (window) {
bool visible = window->IsVisible() && !window->IsMinimized();
if (!visible) // Default state is visible.
command_line->AppendSwitch("hidden-page");
command_line->AppendSwitch(switches::kHiddenPage);
} else {
// Inherit initial visibilty state from parent window in webviews
bool hidden_page;
if (web_preferences.GetBoolean(options::kHiddenPage, &hidden_page) &&
hidden_page) {
command_line->AppendSwitch(switches::kHiddenPage);
}
}
}