Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2777223004: Migrate IME state update flow (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/android/ime_adapter_android.cc ('k') | content/public/android/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 RenderWidgetHostViewBase* updated_view, 711 RenderWidgetHostViewBase* updated_view,
712 bool did_change_state) { 712 bool did_change_state) {
713 DCHECK_EQ(text_input_manager_, text_input_manager); 713 DCHECK_EQ(text_input_manager_, text_input_manager);
714 // If there are no active widgets, the TextInputState.type should be reported 714 // If there are no active widgets, the TextInputState.type should be reported
715 // as none. 715 // as none.
716 const TextInputState& state = 716 const TextInputState& state =
717 GetTextInputManager()->GetActiveWidget() 717 GetTextInputManager()->GetActiveWidget()
718 ? *GetTextInputManager()->GetTextInputState() 718 ? *GetTextInputManager()->GetTextInputState()
719 : TextInputState(); 719 : TextInputState();
720 720
721 if (!content_view_core_ || is_in_vr_) 721 if (!ime_adapter_android_ || is_in_vr_)
722 return; 722 return;
723 723
724 content_view_core_->UpdateImeAdapter( 724 ime_adapter_android_->UpdateState(state);
725 static_cast<int>(state.type), state.flags, state.mode, state.value,
726 state.selection_start, state.selection_end, state.composition_start,
727 state.composition_end, state.show_ime_if_needed, state.reply_to_request);
728 } 725 }
729 726
730 void RenderWidgetHostViewAndroid::OnImeCompositionRangeChanged( 727 void RenderWidgetHostViewAndroid::OnImeCompositionRangeChanged(
731 TextInputManager* text_input_manager, 728 TextInputManager* text_input_manager,
732 RenderWidgetHostViewBase* updated_view) { 729 RenderWidgetHostViewBase* updated_view) {
733 DCHECK_EQ(text_input_manager_, text_input_manager); 730 DCHECK_EQ(text_input_manager_, text_input_manager);
734 const TextInputManager::CompositionRangeInfo* info = 731 const TextInputManager::CompositionRangeInfo* info =
735 text_input_manager_->GetCompositionRangeInfo(); 732 text_input_manager_->GetCompositionRangeInfo();
736 if (!info) 733 if (!info)
737 return; 734 return;
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2175 2172
2176 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); 2173 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor();
2177 if (!compositor) 2174 if (!compositor)
2178 return; 2175 return;
2179 2176
2180 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( 2177 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>(
2181 overscroll_refresh_handler, compositor, view_.GetDipScale()); 2178 overscroll_refresh_handler, compositor, view_.GetDipScale());
2182 } 2179 }
2183 2180
2184 } // namespace content 2181 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/ime_adapter_android.cc ('k') | content/public/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698