Index: cc/trees/layer_tree_host.cc |
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
index d893b33c3374787a4dd4c8ff18e61bf0dce27e8c..92e9c2593fc2a2c8a23eb897d85f37a08b143c33 100644 |
--- a/cc/trees/layer_tree_host.cc |
+++ b/cc/trees/layer_tree_host.cc |
@@ -448,8 +448,11 @@ |
host_impl->SetUseGpuRasterization(UseGpuRasterization()); |
shared_bitmap_manager_ = NULL; |
gpu_memory_buffer_manager_ = NULL; |
- top_controls_manager_weak_ptr_ = |
- host_impl->top_controls_manager()->AsWeakPtr(); |
+ if (settings_.calculate_top_controls_position && |
+ host_impl->top_controls_manager()) { |
+ top_controls_manager_weak_ptr_ = |
+ host_impl->top_controls_manager()->AsWeakPtr(); |
+ } |
input_handler_weak_ptr_ = host_impl->AsWeakPtr(); |
return host_impl.Pass(); |
} |
@@ -1155,6 +1158,9 @@ |
void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints, |
TopControlsState current, |
bool animate) { |
+ if (!settings_.calculate_top_controls_position) |
+ return; |
+ |
// Top controls are only used in threaded mode. |
proxy_->ImplThreadTaskRunner()->PostTask( |
FROM_HERE, |