Always create top controls manager.
commit7610e74eacde3468853c9765bd3f726c14df04c1
authorbokan <bokan@chromium.org>
Thu, 5 Mar 2015 16:19:35 +0000 (5 08:19 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 5 Mar 2015 16:20:19 +0000 (5 16:20 +0000)
tree41ae127fea698a6872b12f9e63e595f79a86b7bb
parenta9df577b430b3c3fa58cb2e00dd17c410290c062
Always create top controls manager.

This CL removes the calculate_top_controls_position flag and instead
always creates the top controls manager. The methods of the manager
become no-ops if the top controls height is 0 so that it becomes
effectively enabled when a top controls height gets set.

This fixes the attached bug because some Android Chrome UI pages don't
have top controls but the manager was still created. These pages set
the height to 0 to hide the top controls but the methods of the
manager were still getting called. This caused a crash in Blink since
ScrollBy would try to calculate the shown ratio with a 0 height, causing
a NaN to propagate into Blink.

BUG=460007

Review URL: https://codereview.chromium.org/961023002

Cr-Commit-Position: refs/heads/master@{#319257}
15 files changed:
cc/base/switches.cc
cc/base/switches.h
cc/input/top_controls_manager.cc
cc/input/top_controls_manager_unittest.cc
cc/trees/layer_tree_host.cc
cc/trees/layer_tree_host_impl.cc
cc/trees/layer_tree_host_impl_unittest.cc
cc/trees/layer_tree_settings.cc
cc/trees/layer_tree_settings.h
chrome/android/java/src/org/chromium/chrome/browser/ApplicationInitialization.java
chrome/browser/chromeos/login/chrome_restart_request.cc
content/browser/renderer_host/compositor_impl_android.cc
content/browser/renderer_host/render_process_host_impl.cc
content/public/android/java/src/org/chromium/content/common/ContentSwitches.java
content/renderer/gpu/render_widget_compositor.cc