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 16 matching lines...) Expand all Loading... | |
27 #include "content/browser/accessibility/browser_accessibility_manager_android.h" | 27 #include "content/browser/accessibility/browser_accessibility_manager_android.h" |
28 #include "content/browser/android/content_view_core_impl.h" | 28 #include "content/browser/android/content_view_core_impl.h" |
29 #include "content/browser/android/in_process/synchronous_compositor_impl.h" | 29 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
30 #include "content/browser/android/overscroll_glow.h" | 30 #include "content/browser/android/overscroll_glow.h" |
31 #include "content/browser/gpu/gpu_surface_tracker.h" | 31 #include "content/browser/gpu/gpu_surface_tracker.h" |
32 #include "content/browser/renderer_host/compositor_impl_android.h" | 32 #include "content/browser/renderer_host/compositor_impl_android.h" |
33 #include "content/browser/renderer_host/dip_util.h" | 33 #include "content/browser/renderer_host/dip_util.h" |
34 #include "content/browser/renderer_host/generic_touch_gesture_android.h" | 34 #include "content/browser/renderer_host/generic_touch_gesture_android.h" |
35 #include "content/browser/renderer_host/image_transport_factory_android.h" | 35 #include "content/browser/renderer_host/image_transport_factory_android.h" |
36 #include "content/browser/renderer_host/render_widget_host_impl.h" | 36 #include "content/browser/renderer_host/render_widget_host_impl.h" |
37 #include "content/browser/renderer_host/synthetic_touch_event_android.h" | |
37 #include "content/common/gpu/client/gl_helper.h" | 38 #include "content/common/gpu/client/gl_helper.h" |
38 #include "content/common/gpu/gpu_messages.h" | 39 #include "content/common/gpu/gpu_messages.h" |
40 #include "content/common/input/input_event.h" | |
39 #include "content/common/input_messages.h" | 41 #include "content/common/input_messages.h" |
40 #include "content/common/view_messages.h" | 42 #include "content/common/view_messages.h" |
41 #include "content/public/common/content_switches.h" | 43 #include "content/public/common/content_switches.h" |
42 #include "skia/ext/image_operations.h" | 44 #include "skia/ext/image_operations.h" |
45 #include "third_party/WebKit/public/web/WebInputEvent.h" | |
43 #include "third_party/khronos/GLES2/gl2.h" | 46 #include "third_party/khronos/GLES2/gl2.h" |
44 #include "third_party/khronos/GLES2/gl2ext.h" | 47 #include "third_party/khronos/GLES2/gl2ext.h" |
45 #include "ui/gfx/android/device_display_info.h" | 48 #include "ui/gfx/android/device_display_info.h" |
46 #include "ui/gfx/android/java_bitmap.h" | 49 #include "ui/gfx/android/java_bitmap.h" |
47 #include "ui/gfx/display.h" | 50 #include "ui/gfx/display.h" |
48 #include "ui/gfx/screen.h" | 51 #include "ui/gfx/screen.h" |
49 #include "ui/gfx/size_conversions.h" | 52 #include "ui/gfx/size_conversions.h" |
50 | 53 |
54 using WebKit::WebInputEvent; | |
55 using WebKit::WebTouchEvent; | |
56 | |
51 namespace content { | 57 namespace content { |
52 | 58 |
53 namespace { | 59 namespace { |
54 | 60 |
55 const int kUndefinedOutputSurfaceId = -1; | 61 const int kUndefinedOutputSurfaceId = -1; |
56 const int kMinimumPointerDistance = 50; | 62 const int kMinimumPointerDistance = 50; |
57 | 63 |
58 void InsertSyncPointAndAckForGpu( | 64 void InsertSyncPointAndAckForGpu( |
59 int gpu_host_id, int route_id, const std::string& return_mailbox) { | 65 int gpu_host_id, int route_id, const std::string& return_mailbox) { |
60 uint32 sync_point = | 66 uint32 sync_point = |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
994 gfx::GLSurfaceHandle RenderWidgetHostViewAndroid::GetCompositingSurface() { | 1000 gfx::GLSurfaceHandle RenderWidgetHostViewAndroid::GetCompositingSurface() { |
995 return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); | 1001 return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); |
996 } | 1002 } |
997 | 1003 |
998 void RenderWidgetHostViewAndroid::ProcessAckedTouchEvent( | 1004 void RenderWidgetHostViewAndroid::ProcessAckedTouchEvent( |
999 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { | 1005 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { |
1000 if (content_view_core_) | 1006 if (content_view_core_) |
1001 content_view_core_->ConfirmTouchEvent(ack_result); | 1007 content_view_core_->ConfirmTouchEvent(ack_result); |
1002 } | 1008 } |
1003 | 1009 |
1010 void RenderWidgetHostViewAndroid::QueueInputEventToPlatform( | |
1011 const InputEvent& event) { | |
1012 if (!synthetic_touch_event_) | |
1013 synthetic_touch_event_.reset( | |
1014 new SyntheticTouchEventAndroid(content_view_core_)); | |
1015 | |
1016 if (WebInputEvent::isTouchEventType(event.web_event->type)) { | |
1017 const WebTouchEvent* web_touch = | |
1018 static_cast<const WebTouchEvent*>(event.web_event.get()); | |
1019 | |
1020 synthetic_touch_event_->InjectWebTouchEvent(web_touch); | |
1021 } else | |
1022 NOTREACHED(); // FIXME: implement other types (MouseWheel?) | |
Dominik Grewe
2013/10/21 17:26:44
For Android it should be fine to only have touch s
kouhei (in TOK)
2013/10/25 15:10:18
Got it.
| |
1023 } | |
1024 | |
1004 void RenderWidgetHostViewAndroid::SetHasHorizontalScrollbar( | 1025 void RenderWidgetHostViewAndroid::SetHasHorizontalScrollbar( |
1005 bool has_horizontal_scrollbar) { | 1026 bool has_horizontal_scrollbar) { |
1006 // intentionally empty, like RenderWidgetHostViewViews | 1027 // intentionally empty, like RenderWidgetHostViewViews |
1007 } | 1028 } |
1008 | 1029 |
1009 void RenderWidgetHostViewAndroid::SetScrollOffsetPinning( | 1030 void RenderWidgetHostViewAndroid::SetScrollOffsetPinning( |
1010 bool is_pinned_to_left, bool is_pinned_to_right) { | 1031 bool is_pinned_to_left, bool is_pinned_to_right) { |
1011 // intentionally empty, like RenderWidgetHostViewViews | 1032 // intentionally empty, like RenderWidgetHostViewViews |
1012 } | 1033 } |
1013 | 1034 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1386 // RenderWidgetHostView, public: | 1407 // RenderWidgetHostView, public: |
1387 | 1408 |
1388 // static | 1409 // static |
1389 RenderWidgetHostView* | 1410 RenderWidgetHostView* |
1390 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1411 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
1391 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1412 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
1392 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1413 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
1393 } | 1414 } |
1394 | 1415 |
1395 } // namespace content | 1416 } // namespace content |
OLD | NEW |