OLD | NEW |
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 282 } |
283 | 283 |
284 void RenderWidgetHostViewViews::SetIsLoading(bool is_loading) { | 284 void RenderWidgetHostViewViews::SetIsLoading(bool is_loading) { |
285 is_loading_ = is_loading; | 285 is_loading_ = is_loading; |
286 // Only call ShowCurrentCursor() when it will actually change the cursor. | 286 // Only call ShowCurrentCursor() when it will actually change the cursor. |
287 if (current_cursor_.GetCursorType() == GDK_LAST_CURSOR) | 287 if (current_cursor_.GetCursorType() == GDK_LAST_CURSOR) |
288 ShowCurrentCursor(); | 288 ShowCurrentCursor(); |
289 } | 289 } |
290 | 290 |
291 void RenderWidgetHostViewViews::ImeUpdateTextInputState( | 291 void RenderWidgetHostViewViews::ImeUpdateTextInputState( |
292 WebKit::WebTextInputType type, | 292 ui::TextInputType type, |
| 293 bool can_compose_inline, |
293 const gfx::Rect& caret_rect) { | 294 const gfx::Rect& caret_rect) { |
| 295 // TODO(kinaba): currently, can_compose_inline is ignored and always treated |
| 296 // as true. We need to support "can_compose_inline=false" for PPAPI plugins |
| 297 // that may want to avoid drawing composition-text by themselves and pass |
| 298 // the responsibility to the browser. |
294 DCHECK(GetInputMethod()); | 299 DCHECK(GetInputMethod()); |
295 ui::TextInputType new_type = static_cast<ui::TextInputType>(type); | 300 if (text_input_type_ != type) { |
296 if (text_input_type_ != new_type) { | 301 text_input_type_ = type; |
297 text_input_type_ = new_type; | |
298 GetInputMethod()->OnTextInputTypeChanged(this); | 302 GetInputMethod()->OnTextInputTypeChanged(this); |
299 } | 303 } |
300 if (caret_bounds_ != caret_rect) { | 304 if (caret_bounds_ != caret_rect) { |
301 caret_bounds_ = caret_rect; | 305 caret_bounds_ = caret_rect; |
302 GetInputMethod()->OnCaretBoundsChanged(this); | 306 GetInputMethod()->OnCaretBoundsChanged(this); |
303 } | 307 } |
304 } | 308 } |
305 | 309 |
306 void RenderWidgetHostViewViews::ImeCancelComposition() { | 310 void RenderWidgetHostViewViews::ImeCancelComposition() { |
307 DCHECK(GetInputMethod()); | 311 DCHECK(GetInputMethod()); |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 } | 942 } |
939 | 943 |
940 // static | 944 // static |
941 RenderWidgetHostView* | 945 RenderWidgetHostView* |
942 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 946 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
943 gfx::NativeView widget) { | 947 gfx::NativeView widget) { |
944 gpointer user_data = g_object_get_data(G_OBJECT(widget), | 948 gpointer user_data = g_object_get_data(G_OBJECT(widget), |
945 kRenderWidgetHostViewKey); | 949 kRenderWidgetHostViewKey); |
946 return reinterpret_cast<RenderWidgetHostView*>(user_data); | 950 return reinterpret_cast<RenderWidgetHostView*>(user_data); |
947 } | 951 } |
OLD | NEW |