Chromium Code Reviews| 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/debug/trace_event_impl.h" | 8 #include "base/debug/trace_event_impl.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 | 251 |
| 252 blink::WebPoint WebLayerImpl::scrollPosition() const { | 252 blink::WebPoint WebLayerImpl::scrollPosition() const { |
| 253 return gfx::PointAtOffsetFromOrigin(layer_->scroll_offset()); | 253 return gfx::PointAtOffsetFromOrigin(layer_->scroll_offset()); |
| 254 } | 254 } |
| 255 | 255 |
| 256 WebSize WebLayerImpl::maxScrollPosition() const { | 256 WebSize WebLayerImpl::maxScrollPosition() const { |
| 257 return layer_->MaxScrollOffset(); | 257 return layer_->MaxScrollOffset(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) { | 260 void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) { |
| 261 if (!clip_layer) { | |
| 262 layer_->SetScrollClipLayerId(Layer::INVALID_ID); | |
| 263 return; | |
| 264 } | |
| 261 cc::Layer* cc_clip_layer = | 265 cc::Layer* cc_clip_layer = |
| 262 clip_layer ? static_cast<WebLayerImpl*>(clip_layer)->layer() : 0; | 266 clip_layer ? static_cast<WebLayerImpl*>(clip_layer)->layer() : 0; |
|
aelias_OOO_until_Jul13
2014/03/18 23:17:10
Please also get rid of the null check here.
qinmin
2014/03/18 23:20:43
missed it, done
On 2014/03/18 23:17:10, aelias wro
| |
| 263 layer_->SetScrollClipLayerId(cc_clip_layer->id()); | 267 layer_->SetScrollClipLayerId(cc_clip_layer->id()); |
| 264 } | 268 } |
| 265 | 269 |
| 266 bool WebLayerImpl::scrollable() const { return layer_->scrollable(); } | 270 bool WebLayerImpl::scrollable() const { return layer_->scrollable(); } |
| 267 | 271 |
| 268 void WebLayerImpl::setUserScrollable(bool horizontal, bool vertical) { | 272 void WebLayerImpl::setUserScrollable(bool horizontal, bool vertical) { |
| 269 layer_->SetUserScrollable(horizontal, vertical); | 273 layer_->SetUserScrollable(horizontal, vertical); |
| 270 } | 274 } |
| 271 | 275 |
| 272 bool WebLayerImpl::userScrollableHorizontal() const { | 276 bool WebLayerImpl::userScrollableHorizontal() const { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 436 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { | 440 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { |
| 437 cc::Layer* clip_parent = NULL; | 441 cc::Layer* clip_parent = NULL; |
| 438 if (parent) | 442 if (parent) |
| 439 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 443 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
| 440 layer_->SetClipParent(clip_parent); | 444 layer_->SetClipParent(clip_parent); |
| 441 } | 445 } |
| 442 | 446 |
| 443 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 447 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
| 444 | 448 |
| 445 } // namespace webkit | 449 } // namespace webkit |
| OLD | NEW |