return window_->IsWebViewFocused();
}
+void Window::SetRepresentedFilename(const std::string& filename) {
+ window_->SetRepresentedFilename(filename);
+}
+
+std::string Window::GetRepresentedFilename() {
+ return window_->GetRepresentedFilename();
+}
+
+void Window::SetDocumentEdited(bool edited) {
+ window_->SetDocumentEdited(edited);
+}
+
+bool Window::IsDocumentEdited() {
+ return window_->IsDocumentEdited();
+}
+
void Window::CapturePage(mate::Arguments* args) {
gfx::Rect rect;
base::Callback<void(v8::Handle<v8::Value>)> callback;
rect, base::Bind(&OnCapturePageDone, args->isolate(), callback));
}
-void Window::SetRepresentedFilename(const std::string& filename) {
- window_->SetRepresentedFilename(filename);
-}
-
-std::string Window::GetRepresentedFilename() {
- return window_->GetRepresentedFilename();
-}
-
-void Window::SetDocumentEdited(bool edited) {
- window_->SetDocumentEdited(edited);
-}
-
-bool Window::IsDocumentEdited() {
- return window_->IsDocumentEdited();
+void Window::Print() {
+ window_->Print();
}
mate::Handle<WebContents> Window::GetWebContents(v8::Isolate* isolate) const {
.SetMethod("setRepresentedFilename", &Window::SetRepresentedFilename)
.SetMethod("getRepresentedFilename", &Window::GetRepresentedFilename)
.SetMethod("setDocumentEdited", &Window::SetDocumentEdited)
- .SetMethod("IsDocumentEdited", &Window::IsDocumentEdited)
+ .SetMethod("isDocumentEdited", &Window::IsDocumentEdited)
.SetMethod("_openDevTools", &Window::OpenDevTools)
.SetMethod("closeDevTools", &Window::CloseDevTools)
.SetMethod("isDevToolsOpened", &Window::IsDevToolsOpened)
.SetMethod("blurWebView", &Window::BlurWebView)
.SetMethod("isWebViewFocused", &Window::IsWebViewFocused)
.SetMethod("capturePage", &Window::CapturePage)
+ .SetMethod("print", &Window::Print)
.SetMethod("_getWebContents", &Window::GetWebContents)
.SetMethod("_getDevToolsWebContents", &Window::GetDevToolsWebContents);
}
virtual void SetRepresentedFilename(const std::string& filename);
virtual std::string GetRepresentedFilename();
virtual void SetDocumentEdited(bool edited);
- virtual void SetMenu(ui::MenuModel* menu);
virtual bool IsDocumentEdited();
+ virtual void SetMenu(ui::MenuModel* menu);
virtual bool HasModalDialog();
virtual gfx::NativeWindow GetNativeWindow() = 0;
virtual void CapturePage(const gfx::Rect& rect,
const CapturePageCallback& callback);
+ // Print current page.
+ virtual void Print();
+
// The same with closing a tab in a real browser.
//
// Should be called by platform code when user want to close the window.