| 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 return reinterpret_cast<intptr_t>(&ime_adapter_android_); | 656 return reinterpret_cast<intptr_t>(&ime_adapter_android_); |
| 657 } | 657 } |
| 658 | 658 |
| 659 void RenderWidgetHostViewAndroid::TextInputStateChanged( | 659 void RenderWidgetHostViewAndroid::TextInputStateChanged( |
| 660 const ViewHostMsg_TextInputState_Params& params) { | 660 const ViewHostMsg_TextInputState_Params& params) { |
| 661 if (params.is_non_ime_change) { | 661 if (params.is_non_ime_change) { |
| 662 // Sends an acknowledgement to the renderer of a processed IME event. | 662 // Sends an acknowledgement to the renderer of a processed IME event. |
| 663 host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID())); | 663 host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID())); |
| 664 } | 664 } |
| 665 | 665 |
| 666 if (!IsShowing()) | 666 if (!content_view_core_) |
| 667 return; | 667 return; |
| 668 | 668 |
| 669 content_view_core_->UpdateImeAdapter( | 669 content_view_core_->UpdateImeAdapter( |
| 670 GetNativeImeAdapter(), | 670 GetNativeImeAdapter(), |
| 671 static_cast<int>(params.type), params.flags, | 671 static_cast<int>(params.type), params.flags, |
| 672 params.value, params.selection_start, params.selection_end, | 672 params.value, params.selection_start, params.selection_end, |
| 673 params.composition_start, params.composition_end, | 673 params.composition_start, params.composition_end, |
| 674 params.show_ime_if_needed, params.is_non_ime_change); | 674 params.show_ime_if_needed, params.is_non_ime_change); |
| 675 } | 675 } |
| 676 | 676 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 if (gesture_provider_.OnTouchEvent(*cancel_event).succeeded) { | 764 if (gesture_provider_.OnTouchEvent(*cancel_event).succeeded) { |
| 765 bool causes_scrolling = false; | 765 bool causes_scrolling = false; |
| 766 host_->ForwardTouchEventWithLatencyInfo( | 766 host_->ForwardTouchEventWithLatencyInfo( |
| 767 ui::CreateWebTouchEventFromMotionEvent(*cancel_event, causes_scrolling), | 767 ui::CreateWebTouchEventFromMotionEvent(*cancel_event, causes_scrolling), |
| 768 ui::LatencyInfo()); | 768 ui::LatencyInfo()); |
| 769 } | 769 } |
| 770 } | 770 } |
| 771 | 771 |
| 772 void RenderWidgetHostViewAndroid::OnDidNavigateMainFrameToNewPage() { | 772 void RenderWidgetHostViewAndroid::OnDidNavigateMainFrameToNewPage() { |
| 773 ResetGestureDetection(); | 773 ResetGestureDetection(); |
| 774 ime_adapter_android_.Unblock(); |
| 774 } | 775 } |
| 775 | 776 |
| 776 void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) { | 777 void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) { |
| 777 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); | 778 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); |
| 778 } | 779 } |
| 779 | 780 |
| 780 void RenderWidgetHostViewAndroid::SetMultiTouchZoomSupportEnabled( | 781 void RenderWidgetHostViewAndroid::SetMultiTouchZoomSupportEnabled( |
| 781 bool enabled) { | 782 bool enabled) { |
| 782 gesture_provider_.SetMultiTouchZoomSupportEnabled(enabled); | 783 gesture_provider_.SetMultiTouchZoomSupportEnabled(enabled); |
| 783 } | 784 } |
| (...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 results->orientationAngle = display.RotationAsDegree(); | 2047 results->orientationAngle = display.RotationAsDegree(); |
| 2047 results->orientationType = | 2048 results->orientationType = |
| 2048 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2049 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 2049 gfx::DeviceDisplayInfo info; | 2050 gfx::DeviceDisplayInfo info; |
| 2050 results->depth = info.GetBitsPerPixel(); | 2051 results->depth = info.GetBitsPerPixel(); |
| 2051 results->depthPerComponent = info.GetBitsPerComponent(); | 2052 results->depthPerComponent = info.GetBitsPerComponent(); |
| 2052 results->isMonochrome = (results->depthPerComponent == 0); | 2053 results->isMonochrome = (results->depthPerComponent == 0); |
| 2053 } | 2054 } |
| 2054 | 2055 |
| 2055 } // namespace content | 2056 } // namespace content |
| OLD | NEW |