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

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: Ted's nits 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 if (texture_layer_.get()) 160 if (texture_layer_.get())
161 texture_layer_->ClearClient(); 161 texture_layer_->ClearClient();
162 } 162 }
163 163
164 164
165 bool RenderWidgetHostViewAndroid::OnMessageReceived( 165 bool RenderWidgetHostViewAndroid::OnMessageReceived(
166 const IPC::Message& message) { 166 const IPC::Message& message) {
167 bool handled = true; 167 bool handled = true;
168 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) 168 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message)
169 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeBatchStateChanged_ACK,
170 OnProcessImeBatchStateAck)
171 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) 169 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent)
172 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, 170 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor,
173 OnDidChangeBodyBackgroundColor) 171 OnDidChangeBodyBackgroundColor)
174 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrame, 172 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrame,
175 OnSetNeedsBeginFrame) 173 OnSetNeedsBeginFrame)
176 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, 174 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged,
177 OnTextInputStateChanged) 175 OnTextInputStateChanged)
178 IPC_MESSAGE_UNHANDLED(handled = false) 176 IPC_MESSAGE_UNHANDLED(handled = false)
179 IPC_END_MESSAGE_MAP() 177 IPC_END_MESSAGE_MAP()
180 return handled; 178 return handled;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 ack_caller.Reset(base::Bind(&SendImeEventAck, host_)); 431 ack_caller.Reset(base::Bind(&SendImeEventAck, host_));
434 432
435 if (!IsShowing()) 433 if (!IsShowing())
436 return; 434 return;
437 435
438 content_view_core_->UpdateImeAdapter( 436 content_view_core_->UpdateImeAdapter(
439 GetNativeImeAdapter(), 437 GetNativeImeAdapter(),
440 static_cast<int>(params.type), 438 static_cast<int>(params.type),
441 params.value, params.selection_start, params.selection_end, 439 params.value, params.selection_start, params.selection_end,
442 params.composition_start, params.composition_end, 440 params.composition_start, params.composition_end,
443 params.show_ime_if_needed); 441 params.show_ime_if_needed, params.require_ack);
444 }
445
446 void RenderWidgetHostViewAndroid::OnProcessImeBatchStateAck(bool is_begin) {
447 if (content_view_core_)
448 content_view_core_->ProcessImeBatchStateAck(is_begin);
449 } 442 }
450 443
451 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor( 444 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor(
452 SkColor color) { 445 SkColor color) {
453 if (cached_background_color_ == color) 446 if (cached_background_color_ == color)
454 return; 447 return;
455 448
456 cached_background_color_ = color; 449 cached_background_color_ = color;
457 if (content_view_core_) 450 if (content_view_core_)
458 content_view_core_->OnBackgroundColorChanged(color); 451 content_view_core_->OnBackgroundColorChanged(color);
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 // RenderWidgetHostView, public: 1329 // RenderWidgetHostView, public:
1337 1330
1338 // static 1331 // static
1339 RenderWidgetHostView* 1332 RenderWidgetHostView*
1340 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 1333 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
1341 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 1334 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
1342 return new RenderWidgetHostViewAndroid(rwhi, NULL); 1335 return new RenderWidgetHostViewAndroid(rwhi, NULL);
1343 } 1336 }
1344 1337
1345 } // namespace content 1338 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698