window_->CapturePage(rect, base::Bind(&OnCapturePageDone, callback));
}
+void Window::SetRepresentedFilename(const std::string& filename) {
+ window_->SetRepresentedFilename(filename);
+}
+
+void Window::SetDocumentEdited(bool edited) {
+ window_->SetDocumentEdited(edited);
+}
+
mate::Handle<WebContents> Window::GetWebContents(v8::Isolate* isolate) const {
return WebContents::Create(isolate, window_->GetWebContents());
}
.SetMethod("flashFrame", &Window::FlashFrame)
.SetMethod("setKiosk", &Window::SetKiosk)
.SetMethod("isKiosk", &Window::IsKiosk)
+ .SetMethod("setRepresentedFilename", &Window::SetRepresentedFilename)
+ .SetMethod("setDocumentEdited", &Window::SetDocumentEdited)
.SetMethod("_openDevTools", &Window::OpenDevTools)
.SetMethod("closeDevTools", &Window::CloseDevTools)
.SetMethod("isDevToolsOpened", &Window::IsDevToolsOpened)
void BlurWebView();
bool IsWebViewFocused();
void CapturePage(mate::Arguments* args);
+ void SetRepresentedFilename(const std::string& filename);
+ void SetDocumentEdited(bool edited);
// APIs for WebContents.
mate::Handle<WebContents> GetWebContents(v8::Isolate* isolate) const;
Show();
}
+void NativeWindow::SetRepresentedFilename(const std::string& filename) {
+}
+
+void NativeWindow::SetDocumentEdited(bool edited) {
+}
+
bool NativeWindow::HasModalDialog() {
return has_dialog_attached_;
}
virtual void FlashFrame(bool flash) = 0;
virtual void SetKiosk(bool kiosk) = 0;
virtual bool IsKiosk() = 0;
+ virtual void SetRepresentedFilename(const std::string& filename);
+ virtual void SetDocumentEdited(bool edited);
virtual bool HasModalDialog();
virtual gfx::NativeWindow GetNativeWindow() = 0;
virtual void FlashFrame(bool flash) OVERRIDE;
virtual void SetKiosk(bool kiosk) OVERRIDE;
virtual bool IsKiosk() OVERRIDE;
+ virtual void SetRepresentedFilename(const std::string& filename) OVERRIDE;
+ virtual void SetDocumentEdited(bool edited) OVERRIDE;
virtual bool HasModalDialog() OVERRIDE;
virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
return is_kiosk_;
}
+void NativeWindowMac::SetRepresentedFilename(const std::string& filename) {
+ [window_ setRepresentedFilename:base::SysUTF8ToNSString(filename)];
+}
+
+void NativeWindowMac::SetDocumentEdited(bool edited) {
+ [window_ setDocumentEdited:edited];
+}
+
bool NativeWindowMac::HasModalDialog() {
return [window_ attachedSheet] != nil;
}
Returns whether the window is in kiosk mode.
+### BrowserWindow.setRepresentedFilename(filename)
+
+* `filename` String
+
+__OS X Only__ Sets the pathname of the file the window represents, and the icon
+of the file will show in window's title bar.
+
+### BrowserWindow.setDocumentEdited(edited)
+
+* `edited` Boolean
+
+__OS X Only__ Specifies whether the window’s document has been edited, and the
+icon in titlebar will become grey when set to `true`.
+
### BrowserWindow.openDevTools()
Opens the developer tools.