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
@@ -201,8 +201,8 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() {
|
||||
bool always_on_top =
|
||||
(top_level_window_ex_styles & WS_EX_TOPMOST) == WS_EX_TOPMOST;
|
||||
|
||||
CefWindowDelegateView* delegate_view =
|
||||
new CefWindowDelegateView(GetBackgroundColor(), always_on_top);
|
||||
CefWindowDelegateView* delegate_view = new CefWindowDelegateView(
|
||||
GetBackgroundColor(), always_on_top, GetBoundsChangedCallback());
|
||||
delegate_view->Init(window_info_.window, browser_->web_contents(),
|
||||
gfx::Rect(0, 0, point.x(), point.y()));
|
||||
|
||||
@@ -594,6 +594,17 @@ void CefBrowserPlatformDelegateNativeWin::TranslateMouseEvent(
|
||||
result.pointer_type = blink::WebPointerProperties::PointerType::kMouse;
|
||||
}
|
||||
|
||||
gfx::Point CefBrowserPlatformDelegateNativeWin::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 CefBrowserPlatformDelegateNativeWin::GetMaximumDialogSize() {
|
||||
return GetWindowWidget()->GetWindowBoundsInScreen().size();
|
||||
}
|
||||
|
||||
// static
|
||||
void CefBrowserPlatformDelegateNativeWin::RegisterWindowClass() {
|
||||
static bool registered = false;
|
||||
|
Reference in New Issue
Block a user