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

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

Issue 1652483002: Browser Side Text Input State Tracking for OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small Fixes. Created 4 years, 10 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
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 #include <utility> 8 #include <utility>
9 9
10 #include "base/android/build_info.h" 10 #include "base/android/build_info.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 645
646 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { 646 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) {
647 // There are no cursors on Android. 647 // There are no cursors on Android.
648 } 648 }
649 649
650 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { 650 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) {
651 // Do nothing. The UI notification is handled through ContentViewClient which 651 // Do nothing. The UI notification is handled through ContentViewClient which
652 // is TabContentsDelegate. 652 // is TabContentsDelegate.
653 } 653 }
654 654
655 void RenderWidgetHostViewAndroid::UpdateTextInputState() {
656 RenderWidgetHostViewBase::UpdateTextInputState();
657
658 const TextInputState* state = current_text_input_state();
659 if (!IsShowing())
660 return;
661
662 content_view_core_->UpdateImeAdapter(
663 GetNativeImeAdapter(), static_cast<int>(state->type), state->flags,
664 state->value, state->selection_start, state->selection_end,
665 state->composition_start, state->composition_end,
666 state->show_ime_if_needed, state->is_non_ime_change);
667 }
668
655 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { 669 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() {
656 return reinterpret_cast<intptr_t>(&ime_adapter_android_); 670 return reinterpret_cast<intptr_t>(&ime_adapter_android_);
657 } 671 }
658 672
659 void RenderWidgetHostViewAndroid::TextInputStateChanged(
660 const ViewHostMsg_TextInputState_Params& params) {
661 if (params.is_non_ime_change) {
662 // Sends an acknowledgement to the renderer of a processed IME event.
663 host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID()));
664 }
665
666 if (!IsShowing())
667 return;
668
669 content_view_core_->UpdateImeAdapter(
670 GetNativeImeAdapter(),
671 static_cast<int>(params.type), params.flags,
672 params.value, params.selection_start, params.selection_end,
673 params.composition_start, params.composition_end,
674 params.show_ime_if_needed, params.is_non_ime_change);
675 }
676
677 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { 673 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) {
678 if (cached_background_color_ == color) 674 if (cached_background_color_ == color)
679 return; 675 return;
680 676
681 cached_background_color_ = color; 677 cached_background_color_ = color;
682 if (content_view_core_) 678 if (content_view_core_)
683 content_view_core_->OnBackgroundColorChanged(color); 679 content_view_core_->OnBackgroundColorChanged(color);
684 } 680 }
685 681
686 void RenderWidgetHostViewAndroid::OnSetNeedsBeginFrames(bool enabled) { 682 void RenderWidgetHostViewAndroid::OnSetNeedsBeginFrames(bool enabled) {
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2046 results->orientationAngle = display.RotationAsDegree(); 2042 results->orientationAngle = display.RotationAsDegree();
2047 results->orientationType = 2043 results->orientationType =
2048 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2044 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2049 gfx::DeviceDisplayInfo info; 2045 gfx::DeviceDisplayInfo info;
2050 results->depth = info.GetBitsPerPixel(); 2046 results->depth = info.GetBitsPerPixel();
2051 results->depthPerComponent = info.GetBitsPerComponent(); 2047 results->depthPerComponent = info.GetBitsPerComponent();
2052 results->isMonochrome = (results->depthPerComponent == 0); 2048 results->isMonochrome = (results->depthPerComponent == 0);
2053 } 2049 }
2054 2050
2055 } // namespace content 2051 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698