]> khamidou — GitHub mirrors - electron.git/commitdiff
Add WebContents API for PasteAndMatchStyle.
authorCharlie Hess <charlie@slack-corp.com>
Fri, 15 May 2015 07:15:19 +0000 (00:15 -0700)
committerCharlie Hess <charlie@slack-corp.com>
Fri, 15 May 2015 07:15:19 +0000 (00:15 -0700)
atom/browser/api/atom_api_web_contents.cc
atom/browser/api/atom_api_web_contents.h
atom/renderer/lib/web-view/web-view.coffee

index e228a064f4138d22403c8df08e705b07e9b40da0..99d6fd7cfede2e03c313dd9218a2f52e79d6eee2 100644 (file)
@@ -523,6 +523,10 @@ void WebContents::Paste() {
   web_contents()->Paste();
 }
 
+void WebContents::PasteAndMatchStyle() {
+  web_contents()->PasteAndMatchStyle();
+}
+
 void WebContents::Delete() {
   web_contents()->Delete();
 }
@@ -645,6 +649,7 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
         .SetMethod("cut", &WebContents::Cut)
         .SetMethod("copy", &WebContents::Copy)
         .SetMethod("paste", &WebContents::Paste)
+        .SetMethod("pasteAndMatchStyle", &WebContents::PasteAndMatchStyle)
         .SetMethod("delete", &WebContents::Delete)
         .SetMethod("selectAll", &WebContents::SelectAll)
         .SetMethod("unselect", &WebContents::Unselect)
index e75cfb0267f0b784b82727fbe969578eda1099f6..4661a570f5af973844be2a56b28b6e7c534ab7a6 100644 (file)
@@ -75,6 +75,7 @@ class WebContents : public mate::EventEmitter,
   void Cut();
   void Copy();
   void Paste();
+  void PasteAndMatchStyle();
   void Delete();
   void SelectAll();
   void Unselect();
index bf163c0cfb5c7e59302cae0e4bef531eda37002a..881300c4dd0a66db1183bb185ed38c21caf2c6de 100644 (file)
@@ -261,6 +261,7 @@ registerWebViewElement = ->
     "cut"
     "copy"
     "paste"
+    "pasteAndMatchStyle"
     "delete"
     "selectAll"
     "unselect"