| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 if (!info) | 795 if (!info) |
| 796 return; | 796 return; |
| 797 | 797 |
| 798 std::vector<gfx::RectF> character_bounds; | 798 std::vector<gfx::RectF> character_bounds; |
| 799 for (const gfx::Rect& rect : info->character_bounds) | 799 for (const gfx::Rect& rect : info->character_bounds) |
| 800 character_bounds.emplace_back(rect); | 800 character_bounds.emplace_back(rect); |
| 801 | 801 |
| 802 ime_adapter_android_.SetCharacterBounds(character_bounds); | 802 ime_adapter_android_.SetCharacterBounds(character_bounds); |
| 803 } | 803 } |
| 804 | 804 |
| 805 void RenderWidgetHostViewAndroid::OnImeCancelComposition( |
| 806 TextInputManager* text_input_manager, |
| 807 RenderWidgetHostViewBase* updated_view) { |
| 808 DCHECK_EQ(text_input_manager_, text_input_manager); |
| 809 ime_adapter_android_.CancelComposition(); |
| 810 } |
| 811 |
| 805 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { | 812 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { |
| 806 if (cached_background_color_ == color) | 813 if (cached_background_color_ == color) |
| 807 return; | 814 return; |
| 808 | 815 |
| 809 cached_background_color_ = color; | 816 cached_background_color_ = color; |
| 810 | 817 |
| 811 if (delegated_frame_host_) | 818 if (delegated_frame_host_) |
| 812 delegated_frame_host_->UpdateBackgroundColor(color); | 819 delegated_frame_host_->UpdateBackgroundColor(color); |
| 813 | 820 |
| 814 if (content_view_core_) | 821 if (content_view_core_) |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 | 920 |
| 914 void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) { | 921 void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) { |
| 915 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); | 922 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); |
| 916 } | 923 } |
| 917 | 924 |
| 918 void RenderWidgetHostViewAndroid::SetMultiTouchZoomSupportEnabled( | 925 void RenderWidgetHostViewAndroid::SetMultiTouchZoomSupportEnabled( |
| 919 bool enabled) { | 926 bool enabled) { |
| 920 gesture_provider_.SetMultiTouchZoomSupportEnabled(enabled); | 927 gesture_provider_.SetMultiTouchZoomSupportEnabled(enabled); |
| 921 } | 928 } |
| 922 | 929 |
| 923 void RenderWidgetHostViewAndroid::ImeCancelComposition() { | |
| 924 ime_adapter_android_.CancelComposition(); | |
| 925 } | |
| 926 | |
| 927 | |
| 928 void RenderWidgetHostViewAndroid::FocusedNodeChanged( | 930 void RenderWidgetHostViewAndroid::FocusedNodeChanged( |
| 929 bool is_editable_node, | 931 bool is_editable_node, |
| 930 const gfx::Rect& node_bounds_in_screen) { | 932 const gfx::Rect& node_bounds_in_screen) { |
| 931 ime_adapter_android_.FocusedNodeChanged(is_editable_node); | 933 ime_adapter_android_.FocusedNodeChanged(is_editable_node); |
| 932 } | 934 } |
| 933 | 935 |
| 934 void RenderWidgetHostViewAndroid::RenderProcessGone( | 936 void RenderWidgetHostViewAndroid::RenderProcessGone( |
| 935 base::TerminationStatus status, int error_code) { | 937 base::TerminationStatus status, int error_code) { |
| 936 Destroy(); | 938 Destroy(); |
| 937 } | 939 } |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2083 if (!compositor) | 2085 if (!compositor) |
| 2084 return; | 2086 return; |
| 2085 | 2087 |
| 2086 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2088 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
| 2087 overscroll_refresh_handler, compositor, | 2089 overscroll_refresh_handler, compositor, |
| 2088 ui::GetScaleFactorForNativeView(GetNativeView())); | 2090 ui::GetScaleFactorForNativeView(GetNativeView())); |
| 2089 is_showing_overscroll_glow_ = true; | 2091 is_showing_overscroll_glow_ = true; |
| 2090 } | 2092 } |
| 2091 | 2093 |
| 2092 } // namespace content | 2094 } // namespace content |
| OLD | NEW |