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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { | 655 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { |
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::UpdateTextInputState() { |
660 const ViewHostMsg_TextInputState_Params& params) { | 660 if (!IsShowing()) |
661 if (params.is_non_ime_change) { | 661 return; |
662 // Sends an acknowledgement to the renderer of a processed IME event. | |
663 host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID())); | |
664 } | |
665 | 662 |
666 if (!content_view_core_) | 663 if (!content_view_core_) |
667 return; | 664 return; |
668 | 665 |
| 666 const TextInputState* state = GetFocusedView()->text_input_state(); |
| 667 |
669 content_view_core_->UpdateImeAdapter( | 668 content_view_core_->UpdateImeAdapter( |
670 GetNativeImeAdapter(), | 669 GetNativeImeAdapter(), static_cast<int>(state->type), state->flags, |
671 static_cast<int>(params.type), params.flags, | 670 state->value, state->selection_start, state->selection_end, |
672 params.value, params.selection_start, params.selection_end, | 671 state->composition_start, state->composition_end, |
673 params.composition_start, params.composition_end, | 672 state->show_ime_if_needed, state->is_non_ime_change); |
674 params.show_ime_if_needed, params.is_non_ime_change); | |
675 } | 673 } |
676 | 674 |
677 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { | 675 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { |
678 if (cached_background_color_ == color) | 676 if (cached_background_color_ == color) |
679 return; | 677 return; |
680 | 678 |
681 cached_background_color_ = color; | 679 cached_background_color_ = color; |
682 if (content_view_core_) | 680 if (content_view_core_) |
683 content_view_core_->OnBackgroundColorChanged(color); | 681 content_view_core_->OnBackgroundColorChanged(color); |
684 } | 682 } |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2044 results->orientationAngle = display.RotationAsDegree(); | 2042 results->orientationAngle = display.RotationAsDegree(); |
2045 results->orientationType = | 2043 results->orientationType = |
2046 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2044 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
2047 gfx::DeviceDisplayInfo info; | 2045 gfx::DeviceDisplayInfo info; |
2048 results->depth = info.GetBitsPerPixel(); | 2046 results->depth = info.GetBitsPerPixel(); |
2049 results->depthPerComponent = info.GetBitsPerComponent(); | 2047 results->depthPerComponent = info.GetBitsPerComponent(); |
2050 results->isMonochrome = (results->depthPerComponent == 0); | 2048 results->isMonochrome = (results->depthPerComponent == 0); |
2051 } | 2049 } |
2052 | 2050 |
2053 } // namespace content | 2051 } // namespace content |
OLD | NEW |