| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 246 } |
| 247 | 247 |
| 248 void WebLayerImpl::setScrollPosition(blink::WebPoint position) { | 248 void WebLayerImpl::setScrollPosition(blink::WebPoint position) { |
| 249 layer_->SetScrollOffset(gfx::Point(position).OffsetFromOrigin()); | 249 layer_->SetScrollOffset(gfx::Point(position).OffsetFromOrigin()); |
| 250 } | 250 } |
| 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 { | |
| 257 return layer_->MaxScrollOffset(); | |
| 258 } | |
| 259 | |
| 260 void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) { | 256 void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) { |
| 261 if (!clip_layer) { | 257 if (!clip_layer) { |
| 262 layer_->SetScrollClipLayerId(Layer::INVALID_ID); | 258 layer_->SetScrollClipLayerId(Layer::INVALID_ID); |
| 263 return; | 259 return; |
| 264 } | 260 } |
| 265 layer_->SetScrollClipLayerId(clip_layer->id()); | 261 layer_->SetScrollClipLayerId(clip_layer->id()); |
| 266 } | 262 } |
| 267 | 263 |
| 268 bool WebLayerImpl::scrollable() const { return layer_->scrollable(); } | 264 bool WebLayerImpl::scrollable() const { return layer_->scrollable(); } |
| 269 | 265 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { | 434 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { |
| 439 cc::Layer* clip_parent = NULL; | 435 cc::Layer* clip_parent = NULL; |
| 440 if (parent) | 436 if (parent) |
| 441 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 437 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
| 442 layer_->SetClipParent(clip_parent); | 438 layer_->SetClipParent(clip_parent); |
| 443 } | 439 } |
| 444 | 440 |
| 445 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 441 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
| 446 | 442 |
| 447 } // namespace webkit | 443 } // namespace webkit |
| OLD | NEW |