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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_views.cc

Issue 7976028: Fix infinite loop in GetInputMethod. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
« no previous file with comments | « no previous file | views/widget/widget.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/renderer_host/render_widget_host_view_views.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 265
266 void RenderWidgetHostViewViews::ImeUpdateTextInputState( 266 void RenderWidgetHostViewViews::ImeUpdateTextInputState(
267 ui::TextInputType type, 267 ui::TextInputType type,
268 bool can_compose_inline, 268 bool can_compose_inline,
269 const gfx::Rect& caret_rect) { 269 const gfx::Rect& caret_rect) {
270 // TODO(kinaba): currently, can_compose_inline is ignored and always treated 270 // TODO(kinaba): currently, can_compose_inline is ignored and always treated
271 // as true. We need to support "can_compose_inline=false" for PPAPI plugins 271 // as true. We need to support "can_compose_inline=false" for PPAPI plugins
272 // that may want to avoid drawing composition-text by themselves and pass 272 // that may want to avoid drawing composition-text by themselves and pass
273 // the responsibility to the browser. 273 // the responsibility to the browser.
274 DCHECK(GetInputMethod()); 274
275 // This is async message and by the time the ipc arrived,
276 // RWHVV may be detached from Top level view
277 // (see native_tab_contents_container_viewws.cc) and GetInputMethod
278 // may return NULL;
279 InputMethod* input_method = GetInputMethod();
mmocny 2011/09/21 18:57:53 won't compile, change to: views::InputMethod* ...
280
275 if (text_input_type_ != type) { 281 if (text_input_type_ != type) {
276 text_input_type_ = type; 282 text_input_type_ = type;
277 GetInputMethod()->OnTextInputTypeChanged(this); 283 if (input_method)
284 input_method->OnTextInputTypeChanged(this);
278 } 285 }
279 if (caret_bounds_ != caret_rect) { 286 if (caret_bounds_ != caret_rect) {
280 caret_bounds_ = caret_rect; 287 caret_bounds_ = caret_rect;
281 GetInputMethod()->OnCaretBoundsChanged(this); 288 if (input_method)
289 input_method->OnCaretBoundsChanged(this);
282 } 290 }
283 } 291 }
284 292
285 void RenderWidgetHostViewViews::ImeCancelComposition() { 293 void RenderWidgetHostViewViews::ImeCancelComposition() {
286 DCHECK(GetInputMethod()); 294 DCHECK(GetInputMethod());
287 GetInputMethod()->CancelComposition(this); 295 GetInputMethod()->CancelComposition(this);
288 has_composition_text_ = false; 296 has_composition_text_ = false;
289 } 297 }
290 298
291 void RenderWidgetHostViewViews::DidUpdateBackingStore( 299 void RenderWidgetHostViewViews::DidUpdateBackingStore(
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 } 1020 }
1013 #endif 1021 #endif
1014 1022
1015 #if defined(USE_AURA) 1023 #if defined(USE_AURA)
1016 // static 1024 // static
1017 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( 1025 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
1018 RenderWidgetHost* widget) { 1026 RenderWidgetHost* widget) {
1019 return new RenderWidgetHostViewViews(widget); 1027 return new RenderWidgetHostViewViews(widget);
1020 } 1028 }
1021 #endif 1029 #endif
OLDNEW
« no previous file with comments | « no previous file | views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698