Chromium Code Reviews| Index: ui/views/controls/native/native_view_host_aura.cc |
| diff --git a/ui/views/controls/native/native_view_host_aura.cc b/ui/views/controls/native/native_view_host_aura.cc |
| index 49bf733bbe2ae06567f1b9d148db2255b743ab85..2b0b41d1c98e4edc95c7dd7d460023be8c86353b 100644 |
| --- a/ui/views/controls/native/native_view_host_aura.cc |
| +++ b/ui/views/controls/native/native_view_host_aura.cc |
| @@ -112,6 +112,25 @@ void NativeViewHostAura::OnWindowDestroyed(aura::Window* window) { |
| host_->NativeViewDestroyed(); |
| } |
| +void NativeViewHostAura::OnWindowVisibilityChanged(aura::Window* window, |
|
sky
2014/05/15 22:42:19
Again, I think this should be done at the content
|
| + bool is_visible) { |
| + // To reduce background activity of minimized / non visible browser content, |
| + // we let the native view follow its parent's visibility which will suppress |
| + // further renderer updates. |
| + // Note: In case of browser navigations, the window visibility will change to |
| + // invisible as well and cause long "flashes". By following the parent's |
| + // windows visibility, we only suppress rendering in case of minimizing / |
| + // general invisibility. |
| + if (host_->native_view() && |
| + host_->native_view()->parent() && |
| + is_visible == host_->native_view()->parent()->IsVisible()) { |
| + if (is_visible) |
| + host_->native_view()->Show(); |
| + else |
| + host_->native_view()->Hide(); |
| + } |
| +} |
| + |
| // static |
| NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( |
| NativeViewHost* host) { |