| 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/android/sys_utils.h" | 9 #include "base/android/sys_utils.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 content_view_core_->RemoveLayer(layer_); | 955 content_view_core_->RemoveLayer(layer_); |
| 956 overscroll_effect_->Disable(); | 956 overscroll_effect_->Disable(); |
| 957 } | 957 } |
| 958 | 958 |
| 959 bool RenderWidgetHostViewAndroid::Animate(base::TimeTicks frame_time) { | 959 bool RenderWidgetHostViewAndroid::Animate(base::TimeTicks frame_time) { |
| 960 return overscroll_effect_->Animate(frame_time); | 960 return overscroll_effect_->Animate(frame_time); |
| 961 } | 961 } |
| 962 | 962 |
| 963 void RenderWidgetHostViewAndroid::UpdateAnimationSize( | 963 void RenderWidgetHostViewAndroid::UpdateAnimationSize( |
| 964 const cc::CompositorFrameMetadata& frame_metadata) { | 964 const cc::CompositorFrameMetadata& frame_metadata) { |
| 965 // Disable edge effects for axes on which scrolling is impossible. | |
| 966 gfx::SizeF ceiled_viewport_size = | |
| 967 gfx::ToCeiledSize(frame_metadata.viewport_size); | |
| 968 overscroll_effect_->set_horizontal_overscroll_enabled( | |
| 969 ceiled_viewport_size.width() < frame_metadata.root_layer_size.width()); | |
| 970 overscroll_effect_->set_vertical_overscroll_enabled( | |
| 971 ceiled_viewport_size.height() < frame_metadata.root_layer_size.height()); | |
| 972 overscroll_effect_->set_size(content_size_in_layer_); | 965 overscroll_effect_->set_size(content_size_in_layer_); |
| 973 } | 966 } |
| 974 | 967 |
| 975 void RenderWidgetHostViewAndroid::AcceleratedSurfacePostSubBuffer( | 968 void RenderWidgetHostViewAndroid::AcceleratedSurfacePostSubBuffer( |
| 976 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 969 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
| 977 int gpu_host_id) { | 970 int gpu_host_id) { |
| 978 NOTREACHED(); | 971 NOTREACHED(); |
| 979 } | 972 } |
| 980 | 973 |
| 981 void RenderWidgetHostViewAndroid::AcceleratedSurfaceSuspend() { | 974 void RenderWidgetHostViewAndroid::AcceleratedSurfaceSuspend() { |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1388 // RenderWidgetHostView, public: | 1381 // RenderWidgetHostView, public: |
| 1389 | 1382 |
| 1390 // static | 1383 // static |
| 1391 RenderWidgetHostView* | 1384 RenderWidgetHostView* |
| 1392 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1385 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 1393 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1386 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 1394 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1387 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 1395 } | 1388 } |
| 1396 | 1389 |
| 1397 } // namespace content | 1390 } // namespace content |
| OLD | NEW |