| 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 | 650 |
| 651 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { | 651 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { |
| 652 // Do nothing. The UI notification is handled through ContentViewClient which | 652 // Do nothing. The UI notification is handled through ContentViewClient which |
| 653 // is TabContentsDelegate. | 653 // is TabContentsDelegate. |
| 654 } | 654 } |
| 655 | 655 |
| 656 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { | 656 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { |
| 657 return reinterpret_cast<intptr_t>(&ime_adapter_android_); | 657 return reinterpret_cast<intptr_t>(&ime_adapter_android_); |
| 658 } | 658 } |
| 659 | 659 |
| 660 void RenderWidgetHostViewAndroid::TextInputStateChanged( | 660 void RenderWidgetHostViewAndroid::UpdateInputMethodIfNecessary( |
| 661 const ViewHostMsg_TextInputState_Params& params) { | 661 bool text_input_state_changed) { |
| 662 if (params.is_non_ime_change) { | 662 DCHECK(text_input_state_changed); |
| 663 // Sends an acknowledgement to the renderer of a processed IME event. | |
| 664 host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID())); | |
| 665 } | |
| 666 | |
| 667 if (!content_view_core_) | 663 if (!content_view_core_) |
| 668 return; | 664 return; |
| 669 | 665 |
| 666 TextInputState state = host_->delegate()->GetTextInputState(); |
| 667 |
| 670 content_view_core_->UpdateImeAdapter( | 668 content_view_core_->UpdateImeAdapter( |
| 671 GetNativeImeAdapter(), | 669 GetNativeImeAdapter(), static_cast<int>(state.type), state.flags, |
| 672 static_cast<int>(params.type), params.flags, | 670 state.value, state.selection_start, state.selection_end, |
| 673 params.value, params.selection_start, params.selection_end, | 671 state.composition_start, state.composition_end, state.show_ime_if_needed, |
| 674 params.composition_start, params.composition_end, | 672 state.is_non_ime_change); |
| 675 params.show_ime_if_needed, params.is_non_ime_change); | |
| 676 } | 673 } |
| 677 | 674 |
| 678 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { | 675 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { |
| 679 if (cached_background_color_ == color) | 676 if (cached_background_color_ == color) |
| 680 return; | 677 return; |
| 681 | 678 |
| 682 cached_background_color_ = color; | 679 cached_background_color_ = color; |
| 683 if (content_view_core_) | 680 if (content_view_core_) |
| 684 content_view_core_->OnBackgroundColorChanged(color); | 681 content_view_core_->OnBackgroundColorChanged(color); |
| 685 } | 682 } |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2023 results->orientationAngle = display.RotationAsDegree(); | 2020 results->orientationAngle = display.RotationAsDegree(); |
| 2024 results->orientationType = | 2021 results->orientationType = |
| 2025 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2022 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 2026 gfx::DeviceDisplayInfo info; | 2023 gfx::DeviceDisplayInfo info; |
| 2027 results->depth = info.GetBitsPerPixel(); | 2024 results->depth = info.GetBitsPerPixel(); |
| 2028 results->depthPerComponent = info.GetBitsPerComponent(); | 2025 results->depthPerComponent = info.GetBitsPerComponent(); |
| 2029 results->isMonochrome = (results->depthPerComponent == 0); | 2026 results->isMonochrome = (results->depthPerComponent == 0); |
| 2030 } | 2027 } |
| 2031 | 2028 |
| 2032 } // namespace content | 2029 } // namespace content |
| OLD | NEW |