Browse Source

insertText is deprecated

Cheng Zhao 8 years ago
parent
commit
6d5339b74e

+ 1 - 0
atom/common/node_bindings.h

@@ -7,6 +7,7 @@
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
+#include "base/single_thread_task_runner.h"
 #include "v8/include/v8.h"
 #include "vendor/node/deps/uv/include/uv.h"
 

+ 5 - 1
atom/renderer/api/atom_api_web_frame.cc

@@ -17,6 +17,8 @@
 #include "native_mate/object_template_builder.h"
 #include "third_party/WebKit/public/web/WebCache.h"
 #include "third_party/WebKit/public/web/WebDocument.h"
+#include "third_party/WebKit/public/web/WebFrameWidget.h"
+#include "third_party/WebKit/public/web/WebInputMethodController.h"
 #include "third_party/WebKit/public/web/WebLocalFrame.h"
 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h"
 #include "third_party/WebKit/public/web/WebScriptSource.h"
@@ -187,7 +189,9 @@ void WebFrame::RegisterURLSchemeAsPrivileged(const std::string& scheme,
 }
 
 void WebFrame::InsertText(const std::string& text) {
-  web_frame_->insertText(blink::WebString::fromUTF8(text));
+  web_frame_->frameWidget()
+            ->getActiveWebInputMethodController()
+            ->commitText(blink::WebString::fromUTF8(text), 0);
 }
 
 void WebFrame::InsertCSS(const std::string& css) {

+ 1 - 0
atom/renderer/guest_view_container.h

@@ -7,6 +7,7 @@
 
 #include "base/callback.h"
 #include "content/public/renderer/browser_plugin_delegate.h"
+#include "content/public/renderer/render_frame.h"
 
 namespace gfx {
 class Size;