| 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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1037 // intentionally empty, like RenderWidgetHostViewViews | 1037 // intentionally empty, like RenderWidgetHostViewViews |
| 1038 } | 1038 } |
| 1039 | 1039 |
| 1040 void RenderWidgetHostViewAndroid::GestureEventAck( | 1040 void RenderWidgetHostViewAndroid::GestureEventAck( |
| 1041 int gesture_event_type, | 1041 int gesture_event_type, |
| 1042 InputEventAckState ack_result) { | 1042 InputEventAckState ack_result) { |
| 1043 if (gesture_event_type == blink::WebInputEvent::GestureScrollUpdate && | 1043 if (gesture_event_type == blink::WebInputEvent::GestureScrollUpdate && |
| 1044 ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) { | 1044 ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) { |
| 1045 content_view_core_->OnScrollUpdateGestureConsumed(); | 1045 content_view_core_->OnScrollUpdateGestureConsumed(); |
| 1046 } | 1046 } |
| 1047 if (gesture_event_type == blink::WebInputEvent::GestureFlingStart && | 1047 if (gesture_event_type == blink::WebInputEvent::GestureFlingStart) { |
| 1048 ack_result == INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS) { | 1048 content_view_core_->OnFlingStartEventAck(ack_result); |
| 1049 content_view_core_->UnhandledFlingStartEvent(); | |
| 1050 } | 1049 } |
| 1051 } | 1050 } |
| 1052 | 1051 |
| 1053 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( | 1052 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( |
| 1054 const blink::WebInputEvent& input_event) { | 1053 const blink::WebInputEvent& input_event) { |
| 1055 if (!host_) | 1054 if (!host_) |
| 1056 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 1055 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| 1057 | 1056 |
| 1058 if (input_event.type == blink::WebInputEvent::GestureTapDown || | 1057 if (input_event.type == blink::WebInputEvent::GestureTapDown || |
| 1059 input_event.type == blink::WebInputEvent::TouchStart) { | 1058 input_event.type == blink::WebInputEvent::TouchStart) { |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1259 return; | 1258 return; |
| 1260 | 1259 |
| 1261 if (overscroll_effect_->OnOverscrolled(content_view_core_->GetLayer(), | 1260 if (overscroll_effect_->OnOverscrolled(content_view_core_->GetLayer(), |
| 1262 base::TimeTicks::Now(), | 1261 base::TimeTicks::Now(), |
| 1263 accumulated_overscroll, | 1262 accumulated_overscroll, |
| 1264 current_fling_velocity)) { | 1263 current_fling_velocity)) { |
| 1265 content_view_core_->SetNeedsAnimate(); | 1264 content_view_core_->SetNeedsAnimate(); |
| 1266 } | 1265 } |
| 1267 } | 1266 } |
| 1268 | 1267 |
| 1268 void RenderWidgetHostViewAndroid::DidStopFlinging() { |
| 1269 if (content_view_core_) |
| 1270 content_view_core_->DidStopFlinging(); |
| 1271 } |
| 1272 |
| 1269 void RenderWidgetHostViewAndroid::SetContentViewCore( | 1273 void RenderWidgetHostViewAndroid::SetContentViewCore( |
| 1270 ContentViewCoreImpl* content_view_core) { | 1274 ContentViewCoreImpl* content_view_core) { |
| 1271 RunAckCallbacks(); | 1275 RunAckCallbacks(); |
| 1272 | 1276 |
| 1273 if (are_layers_attached_) | 1277 if (are_layers_attached_) |
| 1274 RemoveLayers(); | 1278 RemoveLayers(); |
| 1275 | 1279 |
| 1276 if (content_view_core_ && !using_synchronous_compositor_) | 1280 if (content_view_core_ && !using_synchronous_compositor_) |
| 1277 content_view_core_->GetWindowAndroid()->RemoveObserver(this); | 1281 content_view_core_->GetWindowAndroid()->RemoveObserver(this); |
| 1278 | 1282 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1420 // RenderWidgetHostView, public: | 1424 // RenderWidgetHostView, public: |
| 1421 | 1425 |
| 1422 // static | 1426 // static |
| 1423 RenderWidgetHostView* | 1427 RenderWidgetHostView* |
| 1424 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1428 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 1425 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1429 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 1426 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1430 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 1427 } | 1431 } |
| 1428 | 1432 |
| 1429 } // namespace content | 1433 } // namespace content |
| OLD | NEW |