Add printToPDF API skeleton.

This commit is contained in:
Haojian Wu 2015-05-31 10:24:45 +08:00
parent bd704dd8aa
commit b360f7d86a
4 changed files with 12 additions and 0 deletions

View 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)

View 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);

View file

@ -262,6 +262,9 @@ void NativeWindow::Print(bool silent, bool print_background) {
PrintNow(silent, print_background);
}
void NativeWindow::PrintToPDF() {
}
void NativeWindow::ShowDefinitionForSelection() {
NOTIMPLEMENTED();
}

View 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();