| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 return reinterpret_cast<intptr_t>(&ime_adapter_android_); | 664 return reinterpret_cast<intptr_t>(&ime_adapter_android_); |
| 665 } | 665 } |
| 666 | 666 |
| 667 void RenderWidgetHostViewAndroid::TextInputStateChanged( | 667 void RenderWidgetHostViewAndroid::TextInputStateChanged( |
| 668 const ViewHostMsg_TextInputState_Params& params) { | 668 const ViewHostMsg_TextInputState_Params& params) { |
| 669 if (params.is_non_ime_change) { | 669 if (params.is_non_ime_change) { |
| 670 // Sends an acknowledgement to the renderer of a processed IME event. | 670 // Sends an acknowledgement to the renderer of a processed IME event. |
| 671 host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID())); | 671 host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID())); |
| 672 } | 672 } |
| 673 | 673 |
| 674 if (!IsShowing()) | 674 if (!content_view_core_) |
| 675 return; | 675 return; |
| 676 | 676 |
| 677 content_view_core_->UpdateImeAdapter( | 677 content_view_core_->UpdateImeAdapter( |
| 678 GetNativeImeAdapter(), | 678 GetNativeImeAdapter(), |
| 679 static_cast<int>(params.type), params.flags, | 679 static_cast<int>(params.type), params.flags, |
| 680 params.value, params.selection_start, params.selection_end, | 680 params.value, params.selection_start, params.selection_end, |
| 681 params.composition_start, params.composition_end, | 681 params.composition_start, params.composition_end, |
| 682 params.show_ime_if_needed, params.is_non_ime_change); | 682 params.show_ime_if_needed, params.is_non_ime_change); |
| 683 } | 683 } |
| 684 | 684 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 if (gesture_provider_.OnTouchEvent(*cancel_event).succeeded) { | 772 if (gesture_provider_.OnTouchEvent(*cancel_event).succeeded) { |
| 773 bool causes_scrolling = false; | 773 bool causes_scrolling = false; |
| 774 host_->ForwardTouchEventWithLatencyInfo( | 774 host_->ForwardTouchEventWithLatencyInfo( |
| 775 ui::CreateWebTouchEventFromMotionEvent(*cancel_event, causes_scrolling), | 775 ui::CreateWebTouchEventFromMotionEvent(*cancel_event, causes_scrolling), |
| 776 ui::LatencyInfo()); | 776 ui::LatencyInfo()); |
| 777 } | 777 } |
| 778 } | 778 } |
| 779 | 779 |
| 780 void RenderWidgetHostViewAndroid::OnDidNavigateMainFrameToNewPage() { | 780 void RenderWidgetHostViewAndroid::OnDidNavigateMainFrameToNewPage() { |
| 781 ResetGestureDetection(); | 781 ResetGestureDetection(); |
| 782 ime_adapter_android_.Unblock(); |
| 782 } | 783 } |
| 783 | 784 |
| 784 void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) { | 785 void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) { |
| 785 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); | 786 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); |
| 786 } | 787 } |
| 787 | 788 |
| 788 void RenderWidgetHostViewAndroid::SetMultiTouchZoomSupportEnabled( | 789 void RenderWidgetHostViewAndroid::SetMultiTouchZoomSupportEnabled( |
| 789 bool enabled) { | 790 bool enabled) { |
| 790 gesture_provider_.SetMultiTouchZoomSupportEnabled(enabled); | 791 gesture_provider_.SetMultiTouchZoomSupportEnabled(enabled); |
| 791 } | 792 } |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2063 results->orientationAngle = display.RotationAsDegree(); | 2064 results->orientationAngle = display.RotationAsDegree(); |
| 2064 results->orientationType = | 2065 results->orientationType = |
| 2065 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2066 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 2066 gfx::DeviceDisplayInfo info; | 2067 gfx::DeviceDisplayInfo info; |
| 2067 results->depth = info.GetBitsPerPixel(); | 2068 results->depth = info.GetBitsPerPixel(); |
| 2068 results->depthPerComponent = info.GetBitsPerComponent(); | 2069 results->depthPerComponent = info.GetBitsPerComponent(); |
| 2069 results->isMonochrome = (results->depthPerComponent == 0); | 2070 results->isMonochrome = (results->depthPerComponent == 0); |
| 2070 } | 2071 } |
| 2071 | 2072 |
| 2072 } // namespace content | 2073 } // namespace content |
| OLD | NEW |