OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | 5 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "cc/animation/animation.h" | 9 #include "cc/animation/animation.h" |
10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 const WebKit::WebLayerPositionConstraint& constraint) { | 344 const WebKit::WebLayerPositionConstraint& constraint) { |
345 layer_->SetPositionConstraint(ToLayerPositionConstraint(constraint)); | 345 layer_->SetPositionConstraint(ToLayerPositionConstraint(constraint)); |
346 } | 346 } |
347 | 347 |
348 WebKit::WebLayerPositionConstraint WebLayerImpl::positionConstraint() const { | 348 WebKit::WebLayerPositionConstraint WebLayerImpl::positionConstraint() const { |
349 return ToWebLayerPositionConstraint(layer_->position_constraint()); | 349 return ToWebLayerPositionConstraint(layer_->position_constraint()); |
350 } | 350 } |
351 | 351 |
352 void WebLayerImpl::setScrollClient( | 352 void WebLayerImpl::setScrollClient( |
353 WebKit::WebLayerScrollClient* scroll_client) { | 353 WebKit::WebLayerScrollClient* scroll_client) { |
354 layer_->set_did_scroll_callback( | 354 if (scroll_client) { |
355 base::Bind(&WebKit::WebLayerScrollClient::didScroll, | 355 layer_->set_did_scroll_callback( |
356 base::Unretained(scroll_client))); | 356 base::Bind(&WebKit::WebLayerScrollClient::didScroll, |
| 357 base::Unretained(scroll_client))); |
| 358 } else { |
| 359 layer_->set_did_scroll_callback(base::Closure()); |
| 360 } |
357 } | 361 } |
358 | 362 |
359 bool WebLayerImpl::isOrphan() const { return !layer_->layer_tree_host(); } | 363 bool WebLayerImpl::isOrphan() const { return !layer_->layer_tree_host(); } |
360 | 364 |
361 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 365 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
362 | 366 |
363 } // namespace webkit | 367 } // namespace webkit |
OLD | NEW |