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

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

Issue 24195023: Switch to sending IME selection updates early. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Set DEBUG to false Created 7 years, 2 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 | Annotate | Revision Log
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/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 if (texture_layer_.get()) 159 if (texture_layer_.get())
160 texture_layer_->ClearClient(); 160 texture_layer_->ClearClient();
161 } 161 }
162 162
163 163
164 bool RenderWidgetHostViewAndroid::OnMessageReceived( 164 bool RenderWidgetHostViewAndroid::OnMessageReceived(
165 const IPC::Message& message) { 165 const IPC::Message& message) {
166 bool handled = true; 166 bool handled = true;
167 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) 167 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message)
168 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeBatchStateChanged_ACK,
169 OnProcessImeBatchStateAck)
170 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) 168 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent)
171 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, 169 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor,
172 OnDidChangeBodyBackgroundColor) 170 OnDidChangeBodyBackgroundColor)
173 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrame, 171 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrame,
174 OnSetNeedsBeginFrame) 172 OnSetNeedsBeginFrame)
175 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, 173 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged,
176 OnTextInputStateChanged) 174 OnTextInputStateChanged)
177 IPC_MESSAGE_UNHANDLED(handled = false) 175 IPC_MESSAGE_UNHANDLED(handled = false)
178 IPC_END_MESSAGE_MAP() 176 IPC_END_MESSAGE_MAP()
179 return handled; 177 return handled;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 ack_caller.Reset(base::Bind(&SendImeEventAck, host_)); 430 ack_caller.Reset(base::Bind(&SendImeEventAck, host_));
433 431
434 if (!IsShowing()) 432 if (!IsShowing())
435 return; 433 return;
436 434
437 content_view_core_->UpdateImeAdapter( 435 content_view_core_->UpdateImeAdapter(
438 GetNativeImeAdapter(), 436 GetNativeImeAdapter(),
439 static_cast<int>(params.type), 437 static_cast<int>(params.type),
440 params.value, params.selection_start, params.selection_end, 438 params.value, params.selection_start, params.selection_end,
441 params.composition_start, params.composition_end, 439 params.composition_start, params.composition_end,
442 params.show_ime_if_needed); 440 params.show_ime_if_needed, params.require_ack);
443 }
444
445 void RenderWidgetHostViewAndroid::OnProcessImeBatchStateAck(bool is_begin) {
446 if (content_view_core_)
447 content_view_core_->ProcessImeBatchStateAck(is_begin);
448 } 441 }
449 442
450 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor( 443 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor(
451 SkColor color) { 444 SkColor color) {
452 if (cached_background_color_ == color) 445 if (cached_background_color_ == color)
453 return; 446 return;
454 447
455 cached_background_color_ = color; 448 cached_background_color_ = color;
456 if (content_view_core_) 449 if (content_view_core_)
457 content_view_core_->OnBackgroundColorChanged(color); 450 content_view_core_->OnBackgroundColorChanged(color);
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 // RenderWidgetHostView, public: 1304 // RenderWidgetHostView, public:
1312 1305
1313 // static 1306 // static
1314 RenderWidgetHostView* 1307 RenderWidgetHostView*
1315 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 1308 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
1316 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 1309 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
1317 return new RenderWidgetHostViewAndroid(rwhi, NULL); 1310 return new RenderWidgetHostViewAndroid(rwhi, NULL);
1318 } 1311 }
1319 1312
1320 } // namespace content 1313 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698