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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 | 653 |
654 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { | 654 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { |
655 // There are no cursors on Android. | 655 // There are no cursors on Android. |
656 } | 656 } |
657 | 657 |
658 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { | 658 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { |
659 // Do nothing. The UI notification is handled through ContentViewClient which | 659 // Do nothing. The UI notification is handled through ContentViewClient which |
660 // is TabContentsDelegate. | 660 // is TabContentsDelegate. |
661 } | 661 } |
662 | 662 |
663 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { | 663 void RenderWidgetHostViewAndroid::NotifyTextInputStateChanged() { |
664 return reinterpret_cast<intptr_t>(&ime_adapter_android_); | 664 RenderWidgetHostViewBase::NotifyTextInputStateChanged(); |
665 } | |
666 | 665 |
667 void RenderWidgetHostViewAndroid::TextInputStateChanged( | 666 const TextInputState* state = GetCurrentTextInputState(); |
668 const ViewHostMsg_TextInputState_Params& params) { | 667 if (state->is_non_ime_change) { |
669 if (params.is_non_ime_change) { | |
670 // Sends an acknowledgement to the renderer of a processed IME event. | 668 // Sends an acknowledgement to the renderer of a processed IME event. |
671 host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID())); | 669 host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID())); |
672 } | 670 } |
673 | 671 |
674 if (!IsShowing()) | 672 if (!IsShowing()) |
675 return; | 673 return; |
676 | 674 |
677 content_view_core_->UpdateImeAdapter( | 675 content_view_core_->UpdateImeAdapter( |
678 GetNativeImeAdapter(), | 676 GetNativeImeAdapter(), static_cast<int>(state->type), state->flags, |
679 static_cast<int>(params.type), params.flags, | 677 state->value, state->selection_start, state->selection_end, |
680 params.value, params.selection_start, params.selection_end, | 678 state->composition_start, state->composition_end, |
681 params.composition_start, params.composition_end, | 679 state->show_ime_if_needed, state->is_non_ime_change); |
682 params.show_ime_if_needed, params.is_non_ime_change); | 680 } |
| 681 |
| 682 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { |
| 683 return reinterpret_cast<intptr_t>(&ime_adapter_android_); |
683 } | 684 } |
684 | 685 |
685 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { | 686 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { |
686 if (cached_background_color_ == color) | 687 if (cached_background_color_ == color) |
687 return; | 688 return; |
688 | 689 |
689 cached_background_color_ = color; | 690 cached_background_color_ = color; |
690 if (content_view_core_) | 691 if (content_view_core_) |
691 content_view_core_->OnBackgroundColorChanged(color); | 692 content_view_core_->OnBackgroundColorChanged(color); |
692 } | 693 } |
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2063 results->orientationAngle = display.RotationAsDegree(); | 2064 results->orientationAngle = display.RotationAsDegree(); |
2064 results->orientationType = | 2065 results->orientationType = |
2065 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2066 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
2066 gfx::DeviceDisplayInfo info; | 2067 gfx::DeviceDisplayInfo info; |
2067 results->depth = info.GetBitsPerPixel(); | 2068 results->depth = info.GetBitsPerPixel(); |
2068 results->depthPerComponent = info.GetBitsPerComponent(); | 2069 results->depthPerComponent = info.GetBitsPerComponent(); |
2069 results->isMonochrome = (results->depthPerComponent == 0); | 2070 results->isMonochrome = (results->depthPerComponent == 0); |
2070 } | 2071 } |
2071 | 2072 |
2072 } // namespace content | 2073 } // namespace content |
OLD | NEW |