| 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 "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK; | 1217 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK; |
| 1218 } | 1218 } |
| 1219 | 1219 |
| 1220 void RenderWidget::UpdateInputMethod() { | 1220 void RenderWidget::UpdateInputMethod() { |
| 1221 if (!input_method_is_active_) | 1221 if (!input_method_is_active_) |
| 1222 return; | 1222 return; |
| 1223 | 1223 |
| 1224 WebTextInputType new_type = WebKit::WebTextInputTypeNone; | 1224 WebTextInputType new_type = WebKit::WebTextInputTypeNone; |
| 1225 WebRect new_caret_bounds; | 1225 WebRect new_caret_bounds; |
| 1226 | 1226 |
| 1227 if (webwidget_) { | 1227 GetTextInputType(&new_type, &new_caret_bounds); |
| 1228 new_type = webwidget_->textInputType(); | |
| 1229 new_caret_bounds = webwidget_->caretOrSelectionBounds(); | |
| 1230 } | |
| 1231 | 1228 |
| 1232 // Only sends text input type and caret bounds to the browser process if they | 1229 // Only sends text input type and caret bounds to the browser process if they |
| 1233 // are changed. | 1230 // are changed. |
| 1234 if (text_input_type_ != new_type || caret_bounds_ != new_caret_bounds) { | 1231 if (text_input_type_ != new_type || caret_bounds_ != new_caret_bounds) { |
| 1235 text_input_type_ = new_type; | 1232 text_input_type_ = new_type; |
| 1236 caret_bounds_ = new_caret_bounds; | 1233 caret_bounds_ = new_caret_bounds; |
| 1237 Send(new ViewHostMsg_ImeUpdateTextInputState( | 1234 Send(new ViewHostMsg_ImeUpdateTextInputState( |
| 1238 routing_id(), new_type, new_caret_bounds)); | 1235 routing_id(), new_type, new_caret_bounds)); |
| 1239 } | 1236 } |
| 1240 } | 1237 } |
| 1241 | 1238 |
| 1239 void RenderWidget::GetTextInputType(WebKit::WebTextInputType* type, |
| 1240 WebKit::WebRect* caret_bounds) { |
| 1241 if (webwidget_) { |
| 1242 *type = webwidget_->textInputType(); |
| 1243 *caret_bounds = webwidget_->caretOrSelectionBounds(); |
| 1244 } |
| 1245 } |
| 1246 |
| 1242 WebScreenInfo RenderWidget::screenInfo() { | 1247 WebScreenInfo RenderWidget::screenInfo() { |
| 1243 WebScreenInfo results; | 1248 WebScreenInfo results; |
| 1244 Send(new ViewHostMsg_GetScreenInfo(routing_id_, host_window_, &results)); | 1249 Send(new ViewHostMsg_GetScreenInfo(routing_id_, host_window_, &results)); |
| 1245 return results; | 1250 return results; |
| 1246 } | 1251 } |
| 1247 | 1252 |
| 1248 void RenderWidget::resetInputMethod() { | 1253 void RenderWidget::resetInputMethod() { |
| 1249 if (!input_method_is_active_) | 1254 if (!input_method_is_active_) |
| 1250 return; | 1255 return; |
| 1251 | 1256 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 | 1293 |
| 1289 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { | 1294 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { |
| 1290 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); | 1295 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); |
| 1291 i != plugin_window_moves_.end(); ++i) { | 1296 i != plugin_window_moves_.end(); ++i) { |
| 1292 if (i->window == window) { | 1297 if (i->window == window) { |
| 1293 plugin_window_moves_.erase(i); | 1298 plugin_window_moves_.erase(i); |
| 1294 break; | 1299 break; |
| 1295 } | 1300 } |
| 1296 } | 1301 } |
| 1297 } | 1302 } |
| OLD | NEW |