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