Chromium Code Reviews| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 // Unused on Android, which uses OnTextInputChanged instead. | 397 // Unused on Android, which uses OnTextInputChanged instead. |
| 398 } | 398 } |
| 399 | 399 |
| 400 int RenderWidgetHostViewAndroid::GetNativeImeAdapter() { | 400 int RenderWidgetHostViewAndroid::GetNativeImeAdapter() { |
| 401 return reinterpret_cast<int>(&ime_adapter_android_); | 401 return reinterpret_cast<int>(&ime_adapter_android_); |
| 402 } | 402 } |
| 403 | 403 |
| 404 void RenderWidgetHostViewAndroid::OnTextInputStateChanged( | 404 void RenderWidgetHostViewAndroid::OnTextInputStateChanged( |
| 405 const ViewHostMsg_TextInputState_Params& params) { | 405 const ViewHostMsg_TextInputState_Params& params) { |
| 406 #if defined(OS_ANDROID) | 406 #if defined(OS_ANDROID) |
| 407 if (params.require_ack) { | 407 // If an acknowledgement is required for this event, regardless of how we exit |
| 408 // Regardless of how we exit from this method, we must acknowledge that we | 408 // from this method, we must acknowledge that we processed the input state |
| 409 // processed the input state change. | 409 // change. |
| 410 base::ScopedClosureRunner ack_caller(base::Bind(&SendImeEventAck, host_)); | 410 base::ScopedClosureRunner ack_caller(base::Bind(&SendImeEventAck, host_)); |
| 411 } | 411 if (!params.require_ack) ack_caller.Release(); |
|
cjhopman
2013/08/09 00:20:35
Nit: add a break after condition
| |
| 412 #endif | 412 #endif |
| 413 if (!IsShowing()) | 413 if (!IsShowing()) |
| 414 return; | 414 return; |
| 415 | 415 |
| 416 content_view_core_->UpdateImeAdapter( | 416 content_view_core_->UpdateImeAdapter( |
| 417 GetNativeImeAdapter(), | 417 GetNativeImeAdapter(), |
| 418 static_cast<int>(params.type), | 418 static_cast<int>(params.type), |
| 419 params.value, params.selection_start, params.selection_end, | 419 params.value, params.selection_start, params.selection_end, |
| 420 params.composition_start, params.composition_end, | 420 params.composition_start, params.composition_end, |
| 421 params.show_ime_if_needed); | 421 params.show_ime_if_needed); |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1171 // RenderWidgetHostView, public: | 1171 // RenderWidgetHostView, public: |
| 1172 | 1172 |
| 1173 // static | 1173 // static |
| 1174 RenderWidgetHostView* | 1174 RenderWidgetHostView* |
| 1175 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1175 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 1176 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1176 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 1177 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1177 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 1178 } | 1178 } |
| 1179 | 1179 |
| 1180 } // namespace content | 1180 } // namespace content |
| OLD | NEW |