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

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

Issue 18750003: Require ACK for editor-related changes not originating from browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change from using enums to bools for UpdateTextInputState Created 7 years, 4 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
« no previous file with comments | « no previous file | content/common/view_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (!return_mailbox.IsZero()) { 70 if (!return_mailbox.IsZero()) {
71 ack.gl_frame_data->mailbox = return_mailbox; 71 ack.gl_frame_data->mailbox = return_mailbox;
72 ack.gl_frame_data->size = return_size; 72 ack.gl_frame_data->size = return_size;
73 ack.gl_frame_data->sync_point = 73 ack.gl_frame_data->sync_point =
74 ImageTransportFactoryAndroid::GetInstance()->InsertSyncPoint(); 74 ImageTransportFactoryAndroid::GetInstance()->InsertSyncPoint();
75 } 75 }
76 RenderWidgetHostImpl::SendSwapCompositorFrameAck( 76 RenderWidgetHostImpl::SendSwapCompositorFrameAck(
77 route_id, output_surface_id, renderer_host_id, ack); 77 route_id, output_surface_id, renderer_host_id, ack);
78 } 78 }
79 79
80 // Sends an acknowledgement to the renderer of a processed IME event.
81 void SendImeEventAck(RenderWidgetHostImpl* host) {
82 host->Send(new ViewMsg_ImeEventAck(host->GetRoutingID()));
83 }
84
80 } // anonymous namespace 85 } // anonymous namespace
81 86
82 RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( 87 RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid(
83 RenderWidgetHostImpl* widget_host, 88 RenderWidgetHostImpl* widget_host,
84 ContentViewCoreImpl* content_view_core) 89 ContentViewCoreImpl* content_view_core)
85 : host_(widget_host), 90 : host_(widget_host),
86 needs_begin_frame_(false), 91 needs_begin_frame_(false),
87 are_layers_attached_(true), 92 are_layers_attached_(true),
88 content_view_core_(NULL), 93 content_view_core_(NULL),
89 ime_adapter_android_(this), 94 ime_adapter_android_(this),
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 ui::TextInputMode input_mode) { 396 ui::TextInputMode input_mode) {
392 // Unused on Android, which uses OnTextInputChanged instead. 397 // Unused on Android, which uses OnTextInputChanged instead.
393 } 398 }
394 399
395 int RenderWidgetHostViewAndroid::GetNativeImeAdapter() { 400 int RenderWidgetHostViewAndroid::GetNativeImeAdapter() {
396 return reinterpret_cast<int>(&ime_adapter_android_); 401 return reinterpret_cast<int>(&ime_adapter_android_);
397 } 402 }
398 403
399 void RenderWidgetHostViewAndroid::OnTextInputStateChanged( 404 void RenderWidgetHostViewAndroid::OnTextInputStateChanged(
400 const ViewHostMsg_TextInputState_Params& params) { 405 const ViewHostMsg_TextInputState_Params& params) {
406 #if defined(OS_ANDROID)
407 if (params.require_ack) {
408 // Regardless of how we exit from this method, we must acknowledge that we
409 // processed the input state change.
410 base::ScopedClosureRunner ackCaller(base::Bind(&SendImeEventAck, host_));
jam 2013/08/01 22:34:07 nit: ack_caller per style guide btw never saw Sco
nyquist 2013/08/01 23:11:04 Done. Yeah, the ScopedClosureRunner is neat.
411 }
412 #endif
401 if (!IsShowing()) 413 if (!IsShowing())
402 return; 414 return;
403 415
404 content_view_core_->UpdateImeAdapter( 416 content_view_core_->UpdateImeAdapter(
405 GetNativeImeAdapter(), 417 GetNativeImeAdapter(),
406 static_cast<int>(params.type), 418 static_cast<int>(params.type),
407 params.value, params.selection_start, params.selection_end, 419 params.value, params.selection_start, params.selection_end,
408 params.composition_start, params.composition_end, 420 params.composition_start, params.composition_end,
409 params.show_ime_if_needed); 421 params.show_ime_if_needed);
410 } 422 }
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 // RenderWidgetHostView, public: 1156 // RenderWidgetHostView, public:
1145 1157
1146 // static 1158 // static
1147 RenderWidgetHostView* 1159 RenderWidgetHostView*
1148 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 1160 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
1149 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 1161 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
1150 return new RenderWidgetHostViewAndroid(rwhi, NULL); 1162 return new RenderWidgetHostViewAndroid(rwhi, NULL);
1151 } 1163 }
1152 1164
1153 } // namespace content 1165 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698