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 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 | 1292 |
1293 void RenderWidgetHostViewAndroid::MoveCaret(const gfx::Point& point) { | 1293 void RenderWidgetHostViewAndroid::MoveCaret(const gfx::Point& point) { |
1294 if (host_) | 1294 if (host_) |
1295 host_->MoveCaret(point); | 1295 host_->MoveCaret(point); |
1296 } | 1296 } |
1297 | 1297 |
1298 SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const { | 1298 SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const { |
1299 return cached_background_color_; | 1299 return cached_background_color_; |
1300 } | 1300 } |
1301 | 1301 |
1302 void RenderWidgetHostViewAndroid::OnOverscrolled( | 1302 void RenderWidgetHostViewAndroid::DidOverscroll( |
1303 gfx::Vector2dF accumulated_overscroll, | 1303 const DidOverscrollParams& params) { |
1304 gfx::Vector2dF current_fling_velocity) { | |
1305 if (!content_view_core_ || !layer_ || !is_showing_) | 1304 if (!content_view_core_ || !layer_ || !is_showing_) |
1306 return; | 1305 return; |
1307 | 1306 |
1308 const float device_scale_factor = content_view_core_->GetDpiScale(); | 1307 const float device_scale_factor = content_view_core_->GetDpiScale(); |
1309 if (overscroll_effect_->OnOverscrolled( | 1308 if (overscroll_effect_->OnOverscrolled( |
1310 content_view_core_->GetLayer(), | 1309 content_view_core_->GetLayer(), |
1311 base::TimeTicks::Now(), | 1310 base::TimeTicks::Now(), |
1312 gfx::ScaleVector2d(accumulated_overscroll, device_scale_factor), | 1311 gfx::ScaleVector2d(params.accumulated_overscroll, |
1313 gfx::ScaleVector2d(current_fling_velocity, device_scale_factor))) { | 1312 device_scale_factor), |
| 1313 gfx::ScaleVector2d(params.latest_overscroll_delta, |
| 1314 device_scale_factor), |
| 1315 gfx::ScaleVector2d(params.current_fling_velocity, |
| 1316 device_scale_factor))) { |
1314 content_view_core_->SetNeedsAnimate(); | 1317 content_view_core_->SetNeedsAnimate(); |
1315 } | 1318 } |
1316 } | 1319 } |
1317 | 1320 |
1318 void RenderWidgetHostViewAndroid::DidStopFlinging() { | 1321 void RenderWidgetHostViewAndroid::DidStopFlinging() { |
1319 if (content_view_core_) | 1322 if (content_view_core_) |
1320 content_view_core_->DidStopFlinging(); | 1323 content_view_core_->DidStopFlinging(); |
1321 } | 1324 } |
1322 | 1325 |
1323 void RenderWidgetHostViewAndroid::SetContentViewCore( | 1326 void RenderWidgetHostViewAndroid::SetContentViewCore( |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 // RenderWidgetHostView, public: | 1505 // RenderWidgetHostView, public: |
1503 | 1506 |
1504 // static | 1507 // static |
1505 RenderWidgetHostView* | 1508 RenderWidgetHostView* |
1506 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1509 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
1507 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1510 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
1508 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1511 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
1509 } | 1512 } |
1510 | 1513 |
1511 } // namespace content | 1514 } // namespace content |
OLD | NEW |