mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add print preview support (see issue #123)
Pass the `--enable-print-preview` command-line flag to enable. Currently only supported on Windows and Linux.
This commit is contained in:
committed by
Marshall Greenblatt
parent
cf87c88b05
commit
1669c0afbd
@@ -89,7 +89,8 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
|
||||
browser_->AddRef();
|
||||
|
||||
CefWindowDelegateView* delegate_view = new CefWindowDelegateView(
|
||||
GetBackgroundColor(), window_x11_->TopLevelAlwaysOnTop());
|
||||
GetBackgroundColor(), window_x11_->TopLevelAlwaysOnTop(),
|
||||
GetBoundsChangedCallback());
|
||||
delegate_view->Init(window_info_.window, browser_->web_contents(),
|
||||
gfx::Rect(gfx::Point(), rect.size()));
|
||||
|
||||
@@ -410,3 +411,14 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateMouseEvent(
|
||||
|
||||
result.pointer_type = blink::WebPointerProperties::PointerType::kMouse;
|
||||
}
|
||||
|
||||
gfx::Point CefBrowserPlatformDelegateNativeLinux::GetDialogPosition(
|
||||
const gfx::Size& size) {
|
||||
const gfx::Size& max_size = GetMaximumDialogSize();
|
||||
return gfx::Point((max_size.width() - size.width()) / 2,
|
||||
(max_size.height() - size.height()) / 2);
|
||||
}
|
||||
|
||||
gfx::Size CefBrowserPlatformDelegateNativeLinux::GetMaximumDialogSize() {
|
||||
return GetWindowWidget()->GetWindowBoundsInScreen().size();
|
||||
}
|
Reference in New Issue
Block a user