Add printToPDF API skeleton.
authorHaojian Wu <hokein.wu@gmail.com>
Sun, 31 May 2015 02:24:45 +0000 (10:24 +0800)
committerHaojian Wu <hokein.wu@gmail.com>
Tue, 16 Jun 2015 12:02:23 +0000 (20:02 +0800)
atom/browser/api/atom_api_window.cc
atom/browser/api/atom_api_window.h
atom/browser/native_window.cc
atom/browser/native_window.h

index 7461bc7..00a0bb4 100644 (file)
@@ -430,6 +430,10 @@ void Window::Print(mate::Arguments* args) {
   window_->Print(settings.silent, settings.print_background);
 }
 
+void Window::PrintToPDF() {
+  window_->PrintToPDF();
+}
+
 void Window::SetProgressBar(double progress) {
   window_->SetProgressBar(progress);
 }
@@ -542,6 +546,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
       .SetMethod("isWebViewFocused", &Window::IsWebViewFocused)
       .SetMethod("capturePage", &Window::CapturePage)
       .SetMethod("print", &Window::Print)
+      .SetMethod("printToPDF", &Window::PrintToPDF)
       .SetMethod("setProgressBar", &Window::SetProgressBar)
       .SetMethod("setOverlayIcon", &Window::SetOverlayIcon)
       .SetMethod("_setMenu", &Window::SetMenu)
index 43a32e8..606fda9 100644 (file)
@@ -132,6 +132,7 @@ class Window : public mate::EventEmitter,
   bool IsDocumentEdited();
   void CapturePage(mate::Arguments* args);
   void Print(mate::Arguments* args);
+  void PrintToPDF();
   void SetProgressBar(double progress);
   void SetOverlayIcon(const gfx::Image& overlay,
                       const std::string& description);
index 8eb05cb..f019899 100644 (file)
@@ -262,6 +262,9 @@ void NativeWindow::Print(bool silent, bool print_background) {
       PrintNow(silent, print_background);
 }
 
+void NativeWindow::PrintToPDF() {
+}
+
 void NativeWindow::ShowDefinitionForSelection() {
   NOTIMPLEMENTED();
 }
index 2038775..5c99a2c 100644 (file)
@@ -157,6 +157,9 @@ class NativeWindow : public CommonWebContentsDelegate,
   // Print current page.
   virtual void Print(bool silent, bool print_background);
 
+  // Print current page as PDF.
+  virtual void PrintToPDF();
+
   // Show popup dictionary.
   virtual void ShowDefinitionForSelection();