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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2874783004: Remove selected text when committing empty text (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
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 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 bool WebLocalFrameImpl::SetCompositionFromExistingText( 1294 bool WebLocalFrameImpl::SetCompositionFromExistingText(
1295 int composition_start, 1295 int composition_start,
1296 int composition_end, 1296 int composition_end,
1297 const WebVector<WebCompositionUnderline>& underlines) { 1297 const WebVector<WebCompositionUnderline>& underlines) {
1298 TRACE_EVENT0("blink", "WebLocalFrameImpl::setCompositionFromExistingText"); 1298 TRACE_EVENT0("blink", "WebLocalFrameImpl::setCompositionFromExistingText");
1299 if (!GetFrame()->GetEditor().CanEdit()) 1299 if (!GetFrame()->GetEditor().CanEdit())
1300 return false; 1300 return false;
1301 1301
1302 InputMethodController& input_method_controller = 1302 InputMethodController& input_method_controller =
1303 GetFrame()->GetInputMethodController(); 1303 GetFrame()->GetInputMethodController();
1304 input_method_controller.CancelComposition();
1305
1306 if (composition_start == composition_end)
1307 return true;
1308 1304
1309 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets 1305 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
1310 // needs to be audited. See http://crbug.com/590369 for more details. 1306 // needs to be audited. See http://crbug.com/590369 for more details.
1311 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); 1307 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
1312 1308
1313 input_method_controller.SetCompositionFromExistingText( 1309 input_method_controller.SetCompositionFromExistingText(
1314 CompositionUnderlineVectorBuilder::Build(underlines), composition_start, 1310 CompositionUnderlineVectorBuilder::Build(underlines), composition_start,
1315 composition_end); 1311 composition_end);
1316 1312
1317 return true; 1313 return true;
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
2576 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { 2572 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const {
2577 return *text_checker_client_; 2573 return *text_checker_client_;
2578 } 2574 }
2579 2575
2580 void WebLocalFrameImpl::SetTextCheckClient( 2576 void WebLocalFrameImpl::SetTextCheckClient(
2581 WebTextCheckClient* text_check_client) { 2577 WebTextCheckClient* text_check_client) {
2582 text_check_client_ = text_check_client; 2578 text_check_client_ = text_check_client;
2583 } 2579 }
2584 2580
2585 } // namespace blink 2581 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698