Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "cc/layers/delegated_renderer_layer.h" | 15 #include "cc/layers/delegated_renderer_layer.h" |
| 16 #include "cc/layers/layer.h" | 16 #include "cc/layers/layer.h" |
| 17 #include "cc/layers/texture_layer.h" | 17 #include "cc/layers/texture_layer.h" |
| 18 #include "cc/output/compositor_frame.h" | 18 #include "cc/output/compositor_frame.h" |
| 19 #include "cc/output/compositor_frame_ack.h" | 19 #include "cc/output/compositor_frame_ack.h" |
| 20 #include "content/browser/android/content_view_core_impl.h" | 20 #include "content/browser/android/content_view_core_impl.h" |
| 21 #include "content/browser/android/overscroll_glow.h" | |
| 21 #include "content/browser/gpu/gpu_surface_tracker.h" | 22 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 22 #include "content/browser/renderer_host/compositor_impl_android.h" | 23 #include "content/browser/renderer_host/compositor_impl_android.h" |
| 23 #include "content/browser/renderer_host/image_transport_factory_android.h" | 24 #include "content/browser/renderer_host/image_transport_factory_android.h" |
| 24 #include "content/browser/renderer_host/render_widget_host_impl.h" | 25 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 25 #include "content/browser/renderer_host/surface_texture_transport_client_android .h" | 26 #include "content/browser/renderer_host/surface_texture_transport_client_android .h" |
| 26 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_android.h" | 27 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_android.h" |
| 27 #include "content/common/gpu/client/gl_helper.h" | 28 #include "content/common/gpu/client/gl_helper.h" |
| 28 #include "content/common/gpu/gpu_messages.h" | 29 #include "content/common/gpu/gpu_messages.h" |
| 29 #include "content/common/input_messages.h" | 30 #include "content/common/input_messages.h" |
| 30 #include "content/common/view_messages.h" | 31 #include "content/common/view_messages.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 RenderWidgetHostImpl::SendSwapCompositorFrameAck( | 69 RenderWidgetHostImpl::SendSwapCompositorFrameAck( |
| 69 route_id, renderer_host_id, ack); | 70 route_id, renderer_host_id, ack); |
| 70 } | 71 } |
| 71 | 72 |
| 72 } // anonymous namespace | 73 } // anonymous namespace |
| 73 | 74 |
| 74 RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( | 75 RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( |
| 75 RenderWidgetHostImpl* widget_host, | 76 RenderWidgetHostImpl* widget_host, |
| 76 ContentViewCoreImpl* content_view_core) | 77 ContentViewCoreImpl* content_view_core) |
| 77 : host_(widget_host), | 78 : host_(widget_host), |
| 78 is_layer_attached_(true), | 79 are_layers_attached_(true), |
| 79 content_view_core_(NULL), | 80 content_view_core_(NULL), |
| 80 ime_adapter_android_(this), | 81 ime_adapter_android_(this), |
| 81 cached_background_color_(SK_ColorWHITE), | 82 cached_background_color_(SK_ColorWHITE), |
| 82 texture_id_in_layer_(0), | 83 texture_id_in_layer_(0), |
| 83 weak_ptr_factory_(this) { | 84 weak_ptr_factory_(this) { |
| 84 if (CompositorImpl::UsesDirectGL()) { | 85 if (CompositorImpl::UsesDirectGL()) { |
| 85 surface_texture_transport_.reset(new SurfaceTextureTransportClient()); | 86 surface_texture_transport_.reset(new SurfaceTextureTransportClient()); |
| 86 layer_ = surface_texture_transport_->Initialize(); | 87 layer_ = surface_texture_transport_->Initialize(); |
| 87 layer_->SetIsDrawable(true); | 88 layer_->SetIsDrawable(true); |
| 88 } else { | 89 } else { |
| 89 if (CommandLine::ForCurrentProcess()->HasSwitch( | 90 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 90 switches::kEnableDelegatedRenderer)) { | 91 switches::kEnableDelegatedRenderer)) { |
| 91 delegated_renderer_layer_ = cc::DelegatedRendererLayer::Create(this); | 92 delegated_renderer_layer_ = cc::DelegatedRendererLayer::Create(this); |
| 92 layer_ = delegated_renderer_layer_; | 93 layer_ = delegated_renderer_layer_; |
| 93 } else { | 94 } else { |
| 94 texture_layer_ = cc::TextureLayer::Create(this); | 95 texture_layer_ = cc::TextureLayer::Create(this); |
| 95 layer_ = texture_layer_; | 96 layer_ = texture_layer_; |
| 96 } | 97 } |
| 97 } | 98 } |
| 98 | 99 |
| 99 layer_->SetContentsOpaque(true); | 100 layer_->SetContentsOpaque(true); |
| 100 | 101 |
| 102 if (CommandLine::ForCurrentProcess()-> | |
| 103 HasSwitch(switches::kEnableOverscrollEdgeEffect)) { | |
| 104 overscroll_effect_ = OverscrollGlow::Create(); | |
| 105 } | |
| 106 | |
| 101 host_->SetView(this); | 107 host_->SetView(this); |
| 102 SetContentViewCore(content_view_core); | 108 SetContentViewCore(content_view_core); |
| 103 } | 109 } |
| 104 | 110 |
| 105 RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() { | 111 RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() { |
| 106 SetContentViewCore(NULL); | 112 SetContentViewCore(NULL); |
| 107 DCHECK(ack_callbacks_.empty()); | 113 DCHECK(ack_callbacks_.empty()); |
| 108 if (texture_id_in_layer_ || !last_mailbox_.IsZero()) { | 114 if (texture_id_in_layer_ || !last_mailbox_.IsZero()) { |
| 109 ImageTransportFactoryAndroid* factory = | 115 ImageTransportFactoryAndroid* factory = |
| 110 ImageTransportFactoryAndroid::GetInstance(); | 116 ImageTransportFactoryAndroid::GetInstance(); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 host_->Focus(); | 291 host_->Focus(); |
| 286 host_->SetInputMethodActive(true); | 292 host_->SetInputMethodActive(true); |
| 287 ResetClipping(); | 293 ResetClipping(); |
| 288 } | 294 } |
| 289 | 295 |
| 290 void RenderWidgetHostViewAndroid::Blur() { | 296 void RenderWidgetHostViewAndroid::Blur() { |
| 291 host_->Send(new InputMsg_ExecuteEditCommand( | 297 host_->Send(new InputMsg_ExecuteEditCommand( |
| 292 host_->GetRoutingID(), "Unselect", "")); | 298 host_->GetRoutingID(), "Unselect", "")); |
| 293 host_->SetInputMethodActive(false); | 299 host_->SetInputMethodActive(false); |
| 294 host_->Blur(); | 300 host_->Blur(); |
| 301 | |
| 302 if (overscroll_effect_) | |
| 303 overscroll_effect_->Finish(); | |
| 295 } | 304 } |
| 296 | 305 |
| 297 bool RenderWidgetHostViewAndroid::HasFocus() const { | 306 bool RenderWidgetHostViewAndroid::HasFocus() const { |
| 298 if (!content_view_core_) | 307 if (!content_view_core_) |
| 299 return false; // ContentViewCore not created yet. | 308 return false; // ContentViewCore not created yet. |
| 300 | 309 |
| 301 return content_view_core_->HasFocus(); | 310 return content_view_core_->HasFocus(); |
| 302 } | 311 } |
| 303 | 312 |
| 304 bool RenderWidgetHostViewAndroid::IsSurfaceAvailableForCopy() const { | 313 bool RenderWidgetHostViewAndroid::IsSurfaceAvailableForCopy() const { |
| 305 NOTIMPLEMENTED(); | 314 NOTIMPLEMENTED(); |
| 306 return false; | 315 return false; |
| 307 } | 316 } |
| 308 | 317 |
| 309 void RenderWidgetHostViewAndroid::Show() { | 318 void RenderWidgetHostViewAndroid::Show() { |
| 310 if (is_layer_attached_) | 319 if (are_layers_attached_) |
| 311 return; | 320 return; |
| 312 | 321 |
| 313 is_layer_attached_ = true; | 322 are_layers_attached_ = true; |
| 314 if (content_view_core_) | 323 AttachLayers(); |
| 315 content_view_core_->AttachLayer(layer_); | |
| 316 } | 324 } |
| 317 | 325 |
| 318 void RenderWidgetHostViewAndroid::Hide() { | 326 void RenderWidgetHostViewAndroid::Hide() { |
| 319 if (!is_layer_attached_) | 327 if (!are_layers_attached_) |
| 320 return; | 328 return; |
| 321 | 329 |
| 322 is_layer_attached_ = false; | 330 are_layers_attached_ = false; |
| 323 if (content_view_core_) | 331 RemoveLayers(); |
| 324 content_view_core_->RemoveLayer(layer_); | |
| 325 } | 332 } |
| 326 | 333 |
| 327 bool RenderWidgetHostViewAndroid::IsShowing() { | 334 bool RenderWidgetHostViewAndroid::IsShowing() { |
| 328 // ContentViewCoreImpl represents the native side of the Java | 335 // ContentViewCoreImpl represents the native side of the Java |
| 329 // ContentViewCore. It being NULL means that it is not attached | 336 // ContentViewCore. It being NULL means that it is not attached |
| 330 // to the View system yet, so we treat this RWHVA as hidden. | 337 // to the View system yet, so we treat this RWHVA as hidden. |
| 331 return is_layer_attached_ && content_view_core_; | 338 return are_layers_attached_ && content_view_core_; |
| 332 } | 339 } |
| 333 | 340 |
| 334 gfx::Rect RenderWidgetHostViewAndroid::GetViewBounds() const { | 341 gfx::Rect RenderWidgetHostViewAndroid::GetViewBounds() const { |
| 335 if (!content_view_core_) | 342 if (!content_view_core_) |
| 336 return gfx::Rect(); | 343 return gfx::Rect(); |
| 337 | 344 |
| 338 // If the backing hasn't been initialized yet, report empty view bounds | 345 // If the backing hasn't been initialized yet, report empty view bounds |
| 339 // as well. Otherwise, we may end up stuck in a white-screen state because | 346 // as well. Otherwise, we may end up stuck in a white-screen state because |
| 340 // the resize ack is sent after swapbuffers. | 347 // the resize ack is sent after swapbuffers. |
| 341 if (GetPhysicalBackingSize().IsEmpty()) | 348 if (GetPhysicalBackingSize().IsEmpty()) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 SkColor color) { | 404 SkColor color) { |
| 398 if (cached_background_color_ == color) | 405 if (cached_background_color_ == color) |
| 399 return; | 406 return; |
| 400 | 407 |
| 401 cached_background_color_ = color; | 408 cached_background_color_ = color; |
| 402 if (content_view_core_) | 409 if (content_view_core_) |
| 403 content_view_core_->OnBackgroundColorChanged(color); | 410 content_view_core_->OnBackgroundColorChanged(color); |
| 404 } | 411 } |
| 405 | 412 |
| 406 void RenderWidgetHostViewAndroid::SendVSync(base::TimeTicks frame_time) { | 413 void RenderWidgetHostViewAndroid::SendVSync(base::TimeTicks frame_time) { |
| 407 host_->Send(new ViewMsg_DidVSync(host_->GetRoutingID(), frame_time)); | 414 if (host_) |
| 415 host_->Send(new ViewMsg_DidVSync(host_->GetRoutingID(), frame_time)); | |
| 408 } | 416 } |
| 409 | 417 |
| 410 void RenderWidgetHostViewAndroid::OnSetVSyncNotificationEnabled(bool enabled) { | 418 void RenderWidgetHostViewAndroid::OnSetVSyncNotificationEnabled(bool enabled) { |
| 411 if (content_view_core_) | 419 if (content_view_core_) |
| 412 content_view_core_->SetVSyncNotificationEnabled(enabled); | 420 content_view_core_->SetVSyncNotificationEnabled(enabled); |
| 413 } | 421 } |
| 414 | 422 |
| 415 void RenderWidgetHostViewAndroid::OnStartContentIntent( | 423 void RenderWidgetHostViewAndroid::OnStartContentIntent( |
| 416 const GURL& content_url) { | 424 const GURL& content_url) { |
| 417 if (content_view_core_) | 425 if (content_view_core_) |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 433 const std::vector<gfx::Rect>& copy_rects) { | 441 const std::vector<gfx::Rect>& copy_rects) { |
| 434 NOTIMPLEMENTED(); | 442 NOTIMPLEMENTED(); |
| 435 } | 443 } |
| 436 | 444 |
| 437 void RenderWidgetHostViewAndroid::RenderViewGone( | 445 void RenderWidgetHostViewAndroid::RenderViewGone( |
| 438 base::TerminationStatus status, int error_code) { | 446 base::TerminationStatus status, int error_code) { |
| 439 Destroy(); | 447 Destroy(); |
| 440 } | 448 } |
| 441 | 449 |
| 442 void RenderWidgetHostViewAndroid::Destroy() { | 450 void RenderWidgetHostViewAndroid::Destroy() { |
| 443 if (content_view_core_) { | 451 RemoveLayers(); |
| 444 content_view_core_->RemoveLayer(layer_); | 452 content_view_core_ = NULL; |
| 445 content_view_core_ = NULL; | |
| 446 } | |
| 447 | 453 |
| 448 // The RenderWidgetHost's destruction led here, so don't call it. | 454 // The RenderWidgetHost's destruction led here, so don't call it. |
| 449 host_ = NULL; | 455 host_ = NULL; |
| 450 | 456 |
| 451 delete this; | 457 delete this; |
| 452 } | 458 } |
| 453 | 459 |
| 454 void RenderWidgetHostViewAndroid::SetTooltipText( | 460 void RenderWidgetHostViewAndroid::SetTooltipText( |
| 455 const string16& tooltip_text) { | 461 const string16& tooltip_text) { |
| 456 // Tooltips don't makes sense on Android. | 462 // Tooltips don't makes sense on Android. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 573 const cc::CompositorFrame* frame) { | 579 const cc::CompositorFrame* frame) { |
| 574 // Calculate the content size. This should be 0 if the texture_size is 0. | 580 // Calculate the content size. This should be 0 if the texture_size is 0. |
| 575 gfx::Vector2dF offset; | 581 gfx::Vector2dF offset; |
| 576 if (texture_size_in_layer_.GetArea() > 0) | 582 if (texture_size_in_layer_.GetArea() > 0) |
| 577 offset = frame->metadata.location_bar_content_translation; | 583 offset = frame->metadata.location_bar_content_translation; |
| 578 offset.set_y(offset.y() + frame->metadata.overdraw_bottom_height); | 584 offset.set_y(offset.y() + frame->metadata.overdraw_bottom_height); |
| 579 offset.Scale(frame->metadata.device_scale_factor); | 585 offset.Scale(frame->metadata.device_scale_factor); |
| 580 content_size_in_layer_ = | 586 content_size_in_layer_ = |
| 581 gfx::Size(texture_size_in_layer_.width() - offset.x(), | 587 gfx::Size(texture_size_in_layer_.width() - offset.x(), |
| 582 texture_size_in_layer_.height() - offset.y()); | 588 texture_size_in_layer_.height() - offset.y()); |
| 589 // Content size changes should be reflected in associated animation effects. | |
| 590 UpdateAnimationSize(frame); | |
| 583 } | 591 } |
| 584 | 592 |
| 585 void RenderWidgetHostViewAndroid::OnSwapCompositorFrame( | 593 void RenderWidgetHostViewAndroid::OnSwapCompositorFrame( |
| 586 scoped_ptr<cc::CompositorFrame> frame) { | 594 scoped_ptr<cc::CompositorFrame> frame) { |
| 587 // Always let ContentViewCore know about the new frame first, so it can decide | 595 // Always let ContentViewCore know about the new frame first, so it can decide |
| 588 // to schedule a Draw immediately when it sees the texture layer invalidation. | 596 // to schedule a Draw immediately when it sees the texture layer invalidation. |
| 589 if (content_view_core_) { | 597 if (content_view_core_) { |
| 590 // All offsets and sizes are in CSS pixels. | 598 // All offsets and sizes are in CSS pixels. |
| 591 content_view_core_->UpdateFrameInfo( | 599 content_view_core_->UpdateFrameInfo( |
| 592 frame->metadata.root_scroll_offset, | 600 frame->metadata.root_scroll_offset, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 686 ResetClipping(); | 694 ResetClipping(); |
| 687 | 695 |
| 688 current_mailbox_ = mailbox; | 696 current_mailbox_ = mailbox; |
| 689 | 697 |
| 690 if (host_->is_hidden()) | 698 if (host_->is_hidden()) |
| 691 ack_callback.Run(); | 699 ack_callback.Run(); |
| 692 else | 700 else |
| 693 ack_callbacks_.push(ack_callback); | 701 ack_callbacks_.push(ack_callback); |
| 694 } | 702 } |
| 695 | 703 |
| 704 void RenderWidgetHostViewAndroid::AttachLayers() { | |
| 705 if (!content_view_core_) | |
| 706 return; | |
| 707 | |
| 708 content_view_core_->AttachLayer(layer_); | |
| 709 | |
| 710 if (overscroll_effect_) | |
| 711 overscroll_effect_->set_parent_layer(content_view_core_->GetLayer()); | |
|
no sievers
2013/05/13 18:38:24
Is it hard to change it so that it actually attach
jdduke (slow)
2013/05/13 20:44:24
Yeah, I went back and forth on this as well. The
no sievers
2013/05/13 20:53:22
And it doesn't work to just make it not drawable o
| |
| 712 } | |
| 713 | |
| 714 void RenderWidgetHostViewAndroid::RemoveLayers() { | |
| 715 if (!content_view_core_) | |
| 716 return; | |
| 717 | |
| 718 if (overscroll_effect_) | |
| 719 overscroll_effect_->set_parent_layer(NULL); | |
| 720 | |
| 721 content_view_core_->RemoveLayer(layer_); | |
| 722 } | |
| 723 | |
| 724 bool RenderWidgetHostViewAndroid::Animate(base::TimeTicks frame_time) { | |
| 725 if (!overscroll_effect_ || !HasFocus()) | |
| 726 return false; | |
| 727 return overscroll_effect_->Animate(frame_time); | |
| 728 } | |
| 729 | |
| 730 void RenderWidgetHostViewAndroid::UpdateAnimationSize( | |
| 731 const cc::CompositorFrame* frame) { | |
| 732 if (!overscroll_effect_) | |
| 733 return; | |
| 734 // Disable edge effects for axes on which scrolling is impossible. | |
| 735 const cc::CompositorFrameMetadata& metadata = frame->metadata; | |
| 736 overscroll_effect_->set_horizontal_overscroll_enabled( | |
| 737 metadata.root_layer_size.width() != metadata.viewport_size.width()); | |
| 738 overscroll_effect_->set_vertical_overscroll_enabled( | |
| 739 metadata.root_layer_size.height() != metadata.viewport_size.height()); | |
| 740 overscroll_effect_->set_size(content_size_in_layer_); | |
| 741 } | |
| 742 | |
| 743 void RenderWidgetHostViewAndroid::ScheduleAnimationIfNecessary() { | |
| 744 if (!content_view_core_) | |
| 745 return; | |
| 746 if (overscroll_effect_ && overscroll_effect_->IsActive()) | |
| 747 content_view_core_->SetNeedsAnimate(); | |
| 748 } | |
| 749 | |
| 696 void RenderWidgetHostViewAndroid::AcceleratedSurfacePostSubBuffer( | 750 void RenderWidgetHostViewAndroid::AcceleratedSurfacePostSubBuffer( |
| 697 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 751 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
| 698 int gpu_host_id) { | 752 int gpu_host_id) { |
| 699 NOTREACHED(); | 753 NOTREACHED(); |
| 700 } | 754 } |
| 701 | 755 |
| 702 void RenderWidgetHostViewAndroid::AcceleratedSurfaceSuspend() { | 756 void RenderWidgetHostViewAndroid::AcceleratedSurfaceSuspend() { |
| 703 NOTREACHED(); | 757 NOTREACHED(); |
| 704 } | 758 } |
| 705 | 759 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 868 gfx::PointF(offset.x() * uv_scale.x(), | 922 gfx::PointF(offset.x() * uv_scale.x(), |
| 869 offset.y() * uv_scale.y()), | 923 offset.y() * uv_scale.y()), |
| 870 gfx::PointF((offset.x() + clipped_content.width()) * uv_scale.x(), | 924 gfx::PointF((offset.x() + clipped_content.width()) * uv_scale.x(), |
| 871 (offset.y() + clipped_content.height()) * uv_scale.y())); | 925 (offset.y() + clipped_content.height()) * uv_scale.y())); |
| 872 } | 926 } |
| 873 | 927 |
| 874 SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const { | 928 SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const { |
| 875 return cached_background_color_; | 929 return cached_background_color_; |
| 876 } | 930 } |
| 877 | 931 |
| 932 void RenderWidgetHostViewAndroid::OnOverscrolled( | |
| 933 const gfx::Vector2dF& accumulated_overscroll, | |
| 934 const gfx::Vector2dF& current_fling_velocity) { | |
| 935 if (!overscroll_effect_ || !HasFocus()) | |
| 936 return; | |
| 937 overscroll_effect_->OnOverscrolled(base::TimeTicks::Now(), | |
| 938 accumulated_overscroll, | |
| 939 current_fling_velocity); | |
| 940 ScheduleAnimationIfNecessary(); | |
| 941 } | |
| 942 | |
| 878 void RenderWidgetHostViewAndroid::SetContentViewCore( | 943 void RenderWidgetHostViewAndroid::SetContentViewCore( |
| 879 ContentViewCoreImpl* content_view_core) { | 944 ContentViewCoreImpl* content_view_core) { |
| 880 RunAckCallbacks(); | 945 RunAckCallbacks(); |
| 881 | 946 |
| 882 if (content_view_core_ && is_layer_attached_) | 947 if (are_layers_attached_) |
| 883 content_view_core_->RemoveLayer(layer_); | 948 RemoveLayers(); |
| 884 | 949 |
| 885 content_view_core_ = content_view_core; | 950 content_view_core_ = content_view_core; |
| 886 if (content_view_core_ && is_layer_attached_) | 951 |
| 887 content_view_core_->AttachLayer(layer_); | 952 if (are_layers_attached_) |
| 953 AttachLayers(); | |
| 888 } | 954 } |
| 889 | 955 |
| 890 void RenderWidgetHostViewAndroid::RunAckCallbacks() { | 956 void RenderWidgetHostViewAndroid::RunAckCallbacks() { |
| 891 while (!ack_callbacks_.empty()) { | 957 while (!ack_callbacks_.empty()) { |
| 892 ack_callbacks_.front().Run(); | 958 ack_callbacks_.front().Run(); |
| 893 ack_callbacks_.pop(); | 959 ack_callbacks_.pop(); |
| 894 } | 960 } |
| 895 } | 961 } |
| 896 | 962 |
| 897 void RenderWidgetHostViewAndroid::HasTouchEventHandlers( | 963 void RenderWidgetHostViewAndroid::HasTouchEventHandlers( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 938 // RenderWidgetHostView, public: | 1004 // RenderWidgetHostView, public: |
| 939 | 1005 |
| 940 // static | 1006 // static |
| 941 RenderWidgetHostView* | 1007 RenderWidgetHostView* |
| 942 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1008 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 943 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1009 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 944 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1010 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 945 } | 1011 } |
| 946 | 1012 |
| 947 } // namespace content | 1013 } // namespace content |
| OLD | NEW |