| 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/gpu/gpu_surface_tracker.h" | 22 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 22 #include "content/browser/renderer_host/compositor_impl_android.h" | 23 #include "content/browser/renderer_host/compositor_impl_android.h" |
| 23 #include "content/browser/renderer_host/image_transport_factory_android.h" | 24 #include "content/browser/renderer_host/image_transport_factory_android.h" |
| 24 #include "content/browser/renderer_host/render_widget_host_impl.h" | 25 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 25 #include "content/browser/renderer_host/surface_texture_transport_client_android
.h" | 26 #include "content/browser/renderer_host/surface_texture_transport_client_android
.h" |
| 26 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_android.h" | 27 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_android.h" |
| 27 #include "content/common/gpu/client/gl_helper.h" | 28 #include "content/common/gpu/client/gl_helper.h" |
| 28 #include "content/common/gpu/gpu_messages.h" | 29 #include "content/common/gpu/gpu_messages.h" |
| 29 #include "content/common/input_messages.h" | 30 #include "content/common/input_messages.h" |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( | 766 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( |
| 766 const WebKit::WebInputEvent& input_event) { | 767 const WebKit::WebInputEvent& input_event) { |
| 767 if (!content_view_core_) | 768 if (!content_view_core_) |
| 768 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 769 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| 769 | 770 |
| 770 return content_view_core_->FilterInputEvent(input_event); | 771 return content_view_core_->FilterInputEvent(input_event); |
| 771 } | 772 } |
| 772 | 773 |
| 773 void RenderWidgetHostViewAndroid::OnAccessibilityNotifications( | 774 void RenderWidgetHostViewAndroid::OnAccessibilityNotifications( |
| 774 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { | 775 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { |
| 776 if (!GetBrowserAccessibilityManager()) { |
| 777 SetBrowserAccessibilityManager( |
| 778 new BrowserAccessibilityManagerAndroid( |
| 779 content_view_core_, |
| 780 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), |
| 781 this)); |
| 782 } |
| 783 GetBrowserAccessibilityManager()->OnAccessibilityNotifications(params); |
| 784 } |
| 785 |
| 786 void RenderWidgetHostViewAndroid::SetAccessibilityFocus(int acc_obj_id) { |
| 787 if (!host_) |
| 788 return; |
| 789 |
| 790 LOG(INFO) << "SetAccessibilityFocus"; |
| 791 host_->AccessibilitySetFocus(acc_obj_id); |
| 792 } |
| 793 |
| 794 void RenderWidgetHostViewAndroid::AccessibilityDoDefaultAction(int acc_obj_id) { |
| 795 if (!host_) |
| 796 return; |
| 797 |
| 798 host_->AccessibilityDoDefaultAction(acc_obj_id); |
| 799 } |
| 800 |
| 801 void RenderWidgetHostViewAndroid::AccessibilityScrollToMakeVisible( |
| 802 int acc_obj_id, gfx::Rect subfocus) { |
| 803 if (!host_) |
| 804 return; |
| 805 |
| 806 host_->AccessibilityScrollToMakeVisible(acc_obj_id, subfocus); |
| 807 } |
| 808 |
| 809 void RenderWidgetHostViewAndroid::AccessibilityScrollToPoint( |
| 810 int acc_obj_id, gfx::Point point) { |
| 811 if (!host_) |
| 812 return; |
| 813 |
| 814 host_->AccessibilityScrollToPoint(acc_obj_id, point); |
| 815 } |
| 816 |
| 817 void RenderWidgetHostViewAndroid::AccessibilitySetTextSelection( |
| 818 int acc_obj_id, int start_offset, int end_offset) { |
| 819 if (!host_) |
| 820 return; |
| 821 |
| 822 host_->AccessibilitySetTextSelection( |
| 823 acc_obj_id, start_offset, end_offset); |
| 824 } |
| 825 |
| 826 gfx::Point RenderWidgetHostViewAndroid::GetLastTouchEventLocation() const { |
| 827 NOTIMPLEMENTED(); |
| 828 // Only used on Win8 |
| 829 return gfx::Point(); |
| 830 } |
| 831 |
| 832 void RenderWidgetHostViewAndroid::FatalAccessibilityTreeError() { |
| 833 host_->FatalAccessibilityTreeError(); |
| 834 SetBrowserAccessibilityManager(NULL); |
| 775 } | 835 } |
| 776 | 836 |
| 777 bool RenderWidgetHostViewAndroid::LockMouse() { | 837 bool RenderWidgetHostViewAndroid::LockMouse() { |
| 778 NOTIMPLEMENTED(); | 838 NOTIMPLEMENTED(); |
| 779 return false; | 839 return false; |
| 780 } | 840 } |
| 781 | 841 |
| 782 void RenderWidgetHostViewAndroid::UnlockMouse() { | 842 void RenderWidgetHostViewAndroid::UnlockMouse() { |
| 783 NOTIMPLEMENTED(); | 843 NOTIMPLEMENTED(); |
| 784 } | 844 } |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 // RenderWidgetHostView, public: | 998 // RenderWidgetHostView, public: |
| 939 | 999 |
| 940 // static | 1000 // static |
| 941 RenderWidgetHostView* | 1001 RenderWidgetHostView* |
| 942 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1002 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 943 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1003 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 944 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1004 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 945 } | 1005 } |
| 946 | 1006 |
| 947 } // namespace content | 1007 } // namespace content |
| OLD | NEW |