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 <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 | 1164 |
1165 std::unique_ptr<ui::TouchHandleDrawable> | 1165 std::unique_ptr<ui::TouchHandleDrawable> |
1166 RenderWidgetHostViewAndroid::CreateDrawable() { | 1166 RenderWidgetHostViewAndroid::CreateDrawable() { |
1167 DCHECK(content_view_core_); | 1167 DCHECK(content_view_core_); |
1168 if (!using_browser_compositor_) | 1168 if (!using_browser_compositor_) |
1169 return PopupTouchHandleDrawable::Create( | 1169 return PopupTouchHandleDrawable::Create( |
1170 content_view_core_, ui::GetScaleFactorForNativeView(GetNativeView())); | 1170 content_view_core_, ui::GetScaleFactorForNativeView(GetNativeView())); |
1171 | 1171 |
1172 return std::unique_ptr< | 1172 return std::unique_ptr< |
1173 ui::TouchHandleDrawable>(new CompositedTouchHandleDrawable( | 1173 ui::TouchHandleDrawable>(new CompositedTouchHandleDrawable( |
1174 content_view_core_->GetLayer(), | 1174 content_view_core_->GetViewAndroid()->GetLayer(), |
1175 ui::GetScaleFactorForNativeView(GetNativeView()), | 1175 ui::GetScaleFactorForNativeView(GetNativeView()), |
1176 // Use the activity context (instead of the application context) to ensure | 1176 // Use the activity context (instead of the application context) to ensure |
1177 // proper handle theming. | 1177 // proper handle theming. |
1178 content_view_core_->GetContext().obj())); | 1178 content_view_core_->GetContext().obj())); |
1179 } | 1179 } |
1180 | 1180 |
1181 void RenderWidgetHostViewAndroid::SynchronousCopyContents( | 1181 void RenderWidgetHostViewAndroid::SynchronousCopyContents( |
1182 const gfx::Rect& src_subrect_in_pixel, | 1182 const gfx::Rect& src_subrect_in_pixel, |
1183 const gfx::Size& dst_size_in_pixel, | 1183 const gfx::Size& dst_size_in_pixel, |
1184 const ReadbackRequestCallback& callback, | 1184 const ReadbackRequestCallback& callback, |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 cc::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE, frame_time, deadline, | 1417 cc::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE, frame_time, deadline, |
1418 vsync_period, cc::BeginFrameArgs::NORMAL))); | 1418 vsync_period, cc::BeginFrameArgs::NORMAL))); |
1419 if (sync_compositor_) | 1419 if (sync_compositor_) |
1420 sync_compositor_->DidSendBeginFrame(content_view_core_->GetWindowAndroid()); | 1420 sync_compositor_->DidSendBeginFrame(content_view_core_->GetWindowAndroid()); |
1421 } | 1421 } |
1422 | 1422 |
1423 bool RenderWidgetHostViewAndroid::Animate(base::TimeTicks frame_time) { | 1423 bool RenderWidgetHostViewAndroid::Animate(base::TimeTicks frame_time) { |
1424 bool needs_animate = false; | 1424 bool needs_animate = false; |
1425 if (overscroll_controller_) { | 1425 if (overscroll_controller_) { |
1426 needs_animate |= overscroll_controller_->Animate( | 1426 needs_animate |= overscroll_controller_->Animate( |
1427 frame_time, content_view_core_->GetLayer()); | 1427 frame_time, content_view_core_->GetViewAndroid()->GetLayer()); |
1428 } | 1428 } |
1429 if (selection_controller_) | 1429 if (selection_controller_) |
1430 needs_animate |= selection_controller_->Animate(frame_time); | 1430 needs_animate |= selection_controller_->Animate(frame_time); |
1431 return needs_animate; | 1431 return needs_animate; |
1432 } | 1432 } |
1433 | 1433 |
1434 void RenderWidgetHostViewAndroid::RequestDisallowInterceptTouchEvent() { | 1434 void RenderWidgetHostViewAndroid::RequestDisallowInterceptTouchEvent() { |
1435 if (content_view_core_) | 1435 if (content_view_core_) |
1436 content_view_core_->RequestDisallowInterceptTouchEvent(); | 1436 content_view_core_->RequestDisallowInterceptTouchEvent(); |
1437 } | 1437 } |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1984 case ui::MotionEvent::ACTION_UP: | 1984 case ui::MotionEvent::ACTION_UP: |
1985 case ui::MotionEvent::ACTION_POINTER_UP: | 1985 case ui::MotionEvent::ACTION_POINTER_UP: |
1986 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 1986 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
1987 delta.InMicroseconds(), 1, 1000000, 50); | 1987 delta.InMicroseconds(), 1, 1000000, 50); |
1988 default: | 1988 default: |
1989 return; | 1989 return; |
1990 } | 1990 } |
1991 } | 1991 } |
1992 | 1992 |
1993 } // namespace content | 1993 } // namespace content |
OLD | NEW |