summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/text_input_controller.cc
diff options
context:
space:
mode:
authortkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-07 01:00:28 +0000
committertkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-07 01:00:28 +0000
commit64f969cc85a57a0596a8281aa32a9c1560f9e220 (patch)
treeb46b8ef7952804fa758851b808f5575b5f00b451 /webkit/tools/test_shell/text_input_controller.cc
parent632fbb17bac3bca1c0a6e8f45a7357eefae9925f (diff)
downloadchromium_src-64f969cc85a57a0596a8281aa32a9c1560f9e220.zip
chromium_src-64f969cc85a57a0596a8281aa32a9c1560f9e220.tar.gz
chromium_src-64f969cc85a57a0596a8281aa32a9c1560f9e220.tar.bz2
Fix TextInputController::insertText() so that it clear selected text before insertion.
TEST=none BUG=20993 Review URL: http://codereview.chromium.org/199020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/text_input_controller.cc')
-rw-r--r--webkit/tools/test_shell/text_input_controller.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/webkit/tools/test_shell/text_input_controller.cc b/webkit/tools/test_shell/text_input_controller.cc
index 8dfb9a1..8ab7576 100644
--- a/webkit/tools/test_shell/text_input_controller.cc
+++ b/webkit/tools/test_shell/text_input_controller.cc
@@ -52,8 +52,13 @@ void TextInputController::insertText(
if (!main_frame)
return;
- if (args.size() >= 1 && args[0].isString())
+ if (args.size() >= 1 && args[0].isString()) {
+ if (main_frame->hasMarkedText()) {
+ main_frame->unmarkText();
+ main_frame->replaceSelection(WebString());
+ }
main_frame->insertText(WebString::fromUTF8(args[0].ToString()));
+ }
}
void TextInputController::doCommand(