| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 bool WebLocalFrameImpl::SetCompositionFromExistingText( | 1288 bool WebLocalFrameImpl::SetCompositionFromExistingText( |
| 1289 int composition_start, | 1289 int composition_start, |
| 1290 int composition_end, | 1290 int composition_end, |
| 1291 const WebVector<WebCompositionUnderline>& underlines) { | 1291 const WebVector<WebCompositionUnderline>& underlines) { |
| 1292 TRACE_EVENT0("blink", "WebLocalFrameImpl::setCompositionFromExistingText"); | 1292 TRACE_EVENT0("blink", "WebLocalFrameImpl::setCompositionFromExistingText"); |
| 1293 if (!GetFrame()->GetEditor().CanEdit()) | 1293 if (!GetFrame()->GetEditor().CanEdit()) |
| 1294 return false; | 1294 return false; |
| 1295 | 1295 |
| 1296 InputMethodController& input_method_controller = | 1296 InputMethodController& input_method_controller = |
| 1297 GetFrame()->GetInputMethodController(); | 1297 GetFrame()->GetInputMethodController(); |
| 1298 input_method_controller.CancelComposition(); | |
| 1299 | |
| 1300 if (composition_start == composition_end) | |
| 1301 return true; | |
| 1302 | 1298 |
| 1303 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets | 1299 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 1304 // needs to be audited. See http://crbug.com/590369 for more details. | 1300 // needs to be audited. See http://crbug.com/590369 for more details. |
| 1305 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); | 1301 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); |
| 1306 | 1302 |
| 1307 input_method_controller.SetCompositionFromExistingText( | 1303 input_method_controller.SetCompositionFromExistingText( |
| 1308 CompositionUnderlineVectorBuilder(underlines), composition_start, | 1304 CompositionUnderlineVectorBuilder(underlines), composition_start, |
| 1309 composition_end); | 1305 composition_end); |
| 1310 | 1306 |
| 1311 return true; | 1307 return true; |
| (...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2571 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { | 2567 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { |
| 2572 return *text_checker_client_; | 2568 return *text_checker_client_; |
| 2573 } | 2569 } |
| 2574 | 2570 |
| 2575 void WebLocalFrameImpl::SetTextCheckClient( | 2571 void WebLocalFrameImpl::SetTextCheckClient( |
| 2576 WebTextCheckClient* text_check_client) { | 2572 WebTextCheckClient* text_check_client) { |
| 2577 text_check_client_ = text_check_client; | 2573 text_check_client_ = text_check_client; |
| 2578 } | 2574 } |
| 2579 | 2575 |
| 2580 } // namespace blink | 2576 } // namespace blink |
| OLD | NEW |