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/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 // intentionally empty, like RenderWidgetHostViewViews | 1065 // intentionally empty, like RenderWidgetHostViewViews |
1066 } | 1066 } |
1067 | 1067 |
1068 void RenderWidgetHostViewAndroid::GestureEventAck( | 1068 void RenderWidgetHostViewAndroid::GestureEventAck( |
1069 int gesture_event_type, | 1069 int gesture_event_type, |
1070 InputEventAckState ack_result) { | 1070 InputEventAckState ack_result) { |
1071 if (gesture_event_type == blink::WebInputEvent::GestureScrollUpdate && | 1071 if (gesture_event_type == blink::WebInputEvent::GestureScrollUpdate && |
1072 ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) { | 1072 ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) { |
1073 content_view_core_->OnScrollUpdateGestureConsumed(); | 1073 content_view_core_->OnScrollUpdateGestureConsumed(); |
1074 } | 1074 } |
1075 if (gesture_event_type == blink::WebInputEvent::GestureFlingStart && | 1075 if (gesture_event_type == blink::WebInputEvent::GestureFlingStart) { |
1076 ack_result == INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS) { | 1076 content_view_core_->OnFlingStartEventAck(ack_result); |
1077 content_view_core_->UnhandledFlingStartEvent(); | |
1078 } | 1077 } |
1079 } | 1078 } |
1080 | 1079 |
1081 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( | 1080 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( |
1082 const blink::WebInputEvent& input_event) { | 1081 const blink::WebInputEvent& input_event) { |
1083 if (!host_) | 1082 if (!host_) |
1084 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 1083 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
1085 | 1084 |
1086 if (input_event.type == blink::WebInputEvent::GestureTapDown || | 1085 if (input_event.type == blink::WebInputEvent::GestureTapDown || |
1087 input_event.type == blink::WebInputEvent::TouchStart) { | 1086 input_event.type == blink::WebInputEvent::TouchStart) { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 return; | 1286 return; |
1288 | 1287 |
1289 if (overscroll_effect_->OnOverscrolled(content_view_core_->GetLayer(), | 1288 if (overscroll_effect_->OnOverscrolled(content_view_core_->GetLayer(), |
1290 base::TimeTicks::Now(), | 1289 base::TimeTicks::Now(), |
1291 accumulated_overscroll, | 1290 accumulated_overscroll, |
1292 current_fling_velocity)) { | 1291 current_fling_velocity)) { |
1293 content_view_core_->SetNeedsAnimate(); | 1292 content_view_core_->SetNeedsAnimate(); |
1294 } | 1293 } |
1295 } | 1294 } |
1296 | 1295 |
| 1296 void RenderWidgetHostViewAndroid::DidStopFlinging() { |
| 1297 if (content_view_core_) |
| 1298 content_view_core_->DidStopFlinging(); |
| 1299 } |
| 1300 |
1297 void RenderWidgetHostViewAndroid::SetContentViewCore( | 1301 void RenderWidgetHostViewAndroid::SetContentViewCore( |
1298 ContentViewCoreImpl* content_view_core) { | 1302 ContentViewCoreImpl* content_view_core) { |
1299 RunAckCallbacks(); | 1303 RunAckCallbacks(); |
1300 | 1304 |
1301 if (are_layers_attached_) | 1305 if (are_layers_attached_) |
1302 RemoveLayers(); | 1306 RemoveLayers(); |
1303 | 1307 |
1304 if (content_view_core_ && !using_synchronous_compositor_) | 1308 if (content_view_core_ && !using_synchronous_compositor_) |
1305 content_view_core_->GetWindowAndroid()->RemoveObserver(this); | 1309 content_view_core_->GetWindowAndroid()->RemoveObserver(this); |
1306 | 1310 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 // RenderWidgetHostView, public: | 1452 // RenderWidgetHostView, public: |
1449 | 1453 |
1450 // static | 1454 // static |
1451 RenderWidgetHostView* | 1455 RenderWidgetHostView* |
1452 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1456 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
1453 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1457 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
1454 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1458 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
1455 } | 1459 } |
1456 | 1460 |
1457 } // namespace content | 1461 } // namespace content |
OLD | NEW |