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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "cc/layers/delegated_renderer_layer.h" | 15 #include "cc/layers/delegated_renderer_layer.h" |
16 #include "cc/layers/layer.h" | 16 #include "cc/layers/layer.h" |
17 #include "cc/layers/texture_layer.h" | 17 #include "cc/layers/texture_layer.h" |
18 #include "cc/output/compositor_frame.h" | 18 #include "cc/output/compositor_frame.h" |
19 #include "cc/output/compositor_frame_ack.h" | 19 #include "cc/output/compositor_frame_ack.h" |
20 #include "content/browser/accessibility/browser_accessibility_manager_android.h" | |
20 #include "content/browser/android/content_view_core_impl.h" | 21 #include "content/browser/android/content_view_core_impl.h" |
21 #include "content/browser/android/overscroll_glow.h" | 22 #include "content/browser/android/overscroll_glow.h" |
22 #include "content/browser/gpu/gpu_surface_tracker.h" | 23 #include "content/browser/gpu/gpu_surface_tracker.h" |
23 #include "content/browser/renderer_host/compositor_impl_android.h" | 24 #include "content/browser/renderer_host/compositor_impl_android.h" |
24 #include "content/browser/renderer_host/image_transport_factory_android.h" | 25 #include "content/browser/renderer_host/image_transport_factory_android.h" |
25 #include "content/browser/renderer_host/render_widget_host_impl.h" | 26 #include "content/browser/renderer_host/render_widget_host_impl.h" |
26 #include "content/browser/renderer_host/surface_texture_transport_client_android .h" | 27 #include "content/browser/renderer_host/surface_texture_transport_client_android .h" |
27 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_android.h" | 28 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_android.h" |
28 #include "content/common/gpu/client/gl_helper.h" | 29 #include "content/common/gpu/client/gl_helper.h" |
29 #include "content/common/gpu/gpu_messages.h" | 30 #include "content/common/gpu/gpu_messages.h" |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
807 } | 808 } |
808 | 809 |
809 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( | 810 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( |
810 const WebKit::WebInputEvent& input_event) { | 811 const WebKit::WebInputEvent& input_event) { |
811 if (!content_view_core_) | 812 if (!content_view_core_) |
812 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 813 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
813 | 814 |
814 return content_view_core_->FilterInputEvent(input_event); | 815 return content_view_core_->FilterInputEvent(input_event); |
815 } | 816 } |
816 | 817 |
817 void RenderWidgetHostViewAndroid::OnAccessibilityNotifications( | 818 void RenderWidgetHostViewAndroid::OnAccessibilityNotifications( |
David Trainor- moved to gerrit
2013/06/04 20:27:18
What causes this event to be thrown? Ideally we'l
dmazzoni
2013/06/07 20:23:16
That's correct - they won't even be sent until the
| |
818 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { | 819 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { |
820 if (!GetBrowserAccessibilityManager()) { | |
821 SetBrowserAccessibilityManager( | |
822 new BrowserAccessibilityManagerAndroid( | |
823 content_view_core_, | |
824 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), | |
825 this)); | |
826 } | |
827 GetBrowserAccessibilityManager()->OnAccessibilityNotifications(params); | |
828 } | |
829 | |
830 void RenderWidgetHostViewAndroid::SetAccessibilityFocus(int acc_obj_id) { | |
831 if (!host_) | |
832 return; | |
833 | |
834 LOG(INFO) << "SetAccessibilityFocus"; | |
David Trainor- moved to gerrit
2013/06/04 20:27:18
Remove
dmazzoni
2013/06/07 20:23:16
Done.
| |
835 host_->AccessibilitySetFocus(acc_obj_id); | |
836 } | |
837 | |
838 void RenderWidgetHostViewAndroid::AccessibilityDoDefaultAction(int acc_obj_id) { | |
839 if (!host_) | |
840 return; | |
841 | |
842 host_->AccessibilityDoDefaultAction(acc_obj_id); | |
843 } | |
844 | |
845 void RenderWidgetHostViewAndroid::AccessibilityScrollToMakeVisible( | |
846 int acc_obj_id, gfx::Rect subfocus) { | |
847 if (!host_) | |
848 return; | |
849 | |
850 host_->AccessibilityScrollToMakeVisible(acc_obj_id, subfocus); | |
851 } | |
852 | |
853 void RenderWidgetHostViewAndroid::AccessibilityScrollToPoint( | |
854 int acc_obj_id, gfx::Point point) { | |
855 if (!host_) | |
856 return; | |
857 | |
858 host_->AccessibilityScrollToPoint(acc_obj_id, point); | |
859 } | |
860 | |
861 void RenderWidgetHostViewAndroid::AccessibilitySetTextSelection( | |
862 int acc_obj_id, int start_offset, int end_offset) { | |
863 if (!host_) | |
864 return; | |
865 | |
866 host_->AccessibilitySetTextSelection( | |
867 acc_obj_id, start_offset, end_offset); | |
868 } | |
869 | |
870 gfx::Point RenderWidgetHostViewAndroid::GetLastTouchEventLocation() const { | |
871 NOTIMPLEMENTED(); | |
872 // Only used on Win8 | |
873 return gfx::Point(); | |
874 } | |
875 | |
876 void RenderWidgetHostViewAndroid::FatalAccessibilityTreeError() { | |
877 host_->FatalAccessibilityTreeError(); | |
878 SetBrowserAccessibilityManager(NULL); | |
819 } | 879 } |
820 | 880 |
821 bool RenderWidgetHostViewAndroid::LockMouse() { | 881 bool RenderWidgetHostViewAndroid::LockMouse() { |
822 NOTIMPLEMENTED(); | 882 NOTIMPLEMENTED(); |
823 return false; | 883 return false; |
824 } | 884 } |
825 | 885 |
826 void RenderWidgetHostViewAndroid::UnlockMouse() { | 886 void RenderWidgetHostViewAndroid::UnlockMouse() { |
827 NOTIMPLEMENTED(); | 887 NOTIMPLEMENTED(); |
828 } | 888 } |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
994 // RenderWidgetHostView, public: | 1054 // RenderWidgetHostView, public: |
995 | 1055 |
996 // static | 1056 // static |
997 RenderWidgetHostView* | 1057 RenderWidgetHostView* |
998 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1058 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
999 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1059 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
1000 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1060 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
1001 } | 1061 } |
1002 | 1062 |
1003 } // namespace content | 1063 } // namespace content |
OLD | NEW |