summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webtextinput_impl.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 22:02:34 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 22:02:34 +0000
commit144199d5848b185b9e7f3f73374bde01eefeedb7 (patch)
tree8dfad57ce2d13502802c81d25e9a751905ac665e /webkit/glue/webtextinput_impl.cc
parenta8f914871101974a4856248630c08454b7a7d294 (diff)
downloadchromium_src-144199d5848b185b9e7f3f73374bde01eefeedb7.zip
chromium_src-144199d5848b185b9e7f3f73374bde01eefeedb7.tar.gz
chromium_src-144199d5848b185b9e7f3f73374bde01eefeedb7.tar.bz2
revert r16006 due to msvc warning.
TBR=playmobil Review URL: http://codereview.chromium.org/113367 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16007 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webtextinput_impl.cc')
-rw-r--r--webkit/glue/webtextinput_impl.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/webkit/glue/webtextinput_impl.cc b/webkit/glue/webtextinput_impl.cc
index 84dcb9b..964a01e 100644
--- a/webkit/glue/webtextinput_impl.cc
+++ b/webkit/glue/webtextinput_impl.cc
@@ -14,9 +14,7 @@ MSVC_POP_WARNING();
#undef LOG
-#include "base/string16.h"
#include "base/string_util.h"
-#include "webkit/glue/glue_util.h"
#include "webkit/glue/webframe_impl.h"
#include "webkit/glue/webtextinput_impl.h"
@@ -36,18 +34,18 @@ WebCore::Editor* WebTextInputImpl::GetEditor() {
return web_frame_impl_->frame()->editor();
}
-void WebTextInputImpl::InsertText(const string16& text) {
- WebCore::String str = webkit_glue::String16ToString(text);
+void WebTextInputImpl::InsertText(const std::string& text) {
+ WebCore::String str(text.c_str());
GetEditor()->insertText(str, NULL);
}
-void WebTextInputImpl::DoCommand(const string16& com) {
+void WebTextInputImpl::DoCommand(const std::string& com) {
if (com.length() <= 2)
return;
// Since we don't have NSControl, we will convert the format of command
// string and call the function on Editor directly.
- string16 command = com;
+ std::string command = com;
// Make sure the first letter is upper case.
command.replace(0, 1, 1, toupper(command.at(0)));
@@ -58,16 +56,16 @@ void WebTextInputImpl::DoCommand(const string16& com) {
// Specially handling commands that Editor::execCommand does not directly
// support.
- if (EqualsASCII(command, "DeleteToEndOfParagraph")) {
+ if (!command.compare("DeleteToEndOfParagraph")) {
DeleteToEndOfParagraph();
- } else if(EqualsASCII(command, "Indent")) {
+ } else if(!command.compare("Indent")) {
GetEditor()->indent();
- } else if(EqualsASCII(command, "Outdent")) {
+ } else if(!command.compare("Outdent")) {
GetEditor()->outdent();
- } else if(EqualsASCII(command, "DeleteBackward")) {
+ } else if(!command.compare("DeleteBackward")) {
WebCore::AtomicString editor_command("BackwardDelete");
GetEditor()->command(editor_command).execute();
- } else if(EqualsASCII(command, "DeleteForward")) {
+ } else if(!command.compare("DeleteForward")) {
WebCore::AtomicString editor_command("ForwardDelete");
GetEditor()->command(editor_command).execute();
} else {
@@ -78,11 +76,11 @@ void WebTextInputImpl::DoCommand(const string16& com) {
return;
}
-void WebTextInputImpl::SetMarkedText(const string16& text,
+void WebTextInputImpl::SetMarkedText(const std::string& text,
int32_t location,
int32_t length) {
WebCore::Editor* editor = GetEditor();
- WebCore::String str = webkit_glue::String16ToString(text);
+ WebCore::String str(text.c_str());
editor->confirmComposition(str);