| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sky/viewer/cc/web_layer_impl.h" | 5 #include "sky/viewer/cc/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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 size_t i = 0; | 372 size_t i = 0; |
| 373 for (cc::Region::Iterator region_rects(layer_->touch_event_handler_region()); | 373 for (cc::Region::Iterator region_rects(layer_->touch_event_handler_region()); |
| 374 region_rects.has_rect(); | 374 region_rects.has_rect(); |
| 375 region_rects.next()) { | 375 region_rects.next()) { |
| 376 result[i] = region_rects.rect(); | 376 result[i] = region_rects.rect(); |
| 377 ++i; | 377 ++i; |
| 378 } | 378 } |
| 379 return result; | 379 return result; |
| 380 } | 380 } |
| 381 | 381 |
| 382 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) { | |
| 383 layer_->SetIsContainerForFixedPositionLayers(enable); | |
| 384 } | |
| 385 | |
| 386 bool WebLayerImpl::isContainerForFixedPositionLayers() const { | |
| 387 return layer_->IsContainerForFixedPositionLayers(); | |
| 388 } | |
| 389 | |
| 390 void WebLayerImpl::setScrollClient(blink::WebLayerScrollClient* scroll_client) { | 382 void WebLayerImpl::setScrollClient(blink::WebLayerScrollClient* scroll_client) { |
| 391 if (scroll_client) { | 383 if (scroll_client) { |
| 392 layer_->set_did_scroll_callback( | 384 layer_->set_did_scroll_callback( |
| 393 base::Bind(&blink::WebLayerScrollClient::didScroll, | 385 base::Bind(&blink::WebLayerScrollClient::didScroll, |
| 394 base::Unretained(scroll_client))); | 386 base::Unretained(scroll_client))); |
| 395 } else { | 387 } else { |
| 396 layer_->set_did_scroll_callback(base::Closure()); | 388 layer_->set_did_scroll_callback(base::Closure()); |
| 397 } | 389 } |
| 398 } | 390 } |
| 399 | 391 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 if (parent) | 440 if (parent) |
| 449 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 441 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
| 450 layer_->SetClipParent(clip_parent); | 442 layer_->SetClipParent(clip_parent); |
| 451 } | 443 } |
| 452 | 444 |
| 453 Layer* WebLayerImpl::layer() const { | 445 Layer* WebLayerImpl::layer() const { |
| 454 return layer_.get(); | 446 return layer_.get(); |
| 455 } | 447 } |
| 456 | 448 |
| 457 } // namespace sky_viewer_cc | 449 } // namespace sky_viewer_cc |
| OLD | NEW |