Only pass scrolls directly on the root scroll layer to top controls.

Do not rely on bubble scrolling to move top controls.

BUG=181686


Review URL: https://chromiumcodereview.appspot.com/12440038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188269 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index bcd32485..2a6473c 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -1485,6 +1485,9 @@
   gfx::Vector2dF pending_delta = scroll_delta;
   bool did_scroll = false;
 
+  if (top_controls_manager_ && CurrentlyScrollingLayer() == RootScrollLayer())
+    pending_delta = top_controls_manager_->ScrollBy(pending_delta);
+
   for (LayerImpl* layer_impl = CurrentlyScrollingLayer();
        layer_impl;
        layer_impl = layer_impl->parent()) {
@@ -1492,9 +1495,6 @@
       continue;
 
     gfx::Vector2dF applied_delta;
-    if (top_controls_manager_ && layer_impl == RootScrollLayer())
-      pending_delta = top_controls_manager_->ScrollBy(pending_delta);
-
     // Gesture events need to be transformed from viewport coordinates to local
     // layer coordinates so that the scrolling contents exactly follow the
     // user's finger. In contrast, wheel events represent a fixed amount of