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:
Ananyo Maiti
2019-07-17 14:47:27 -04:00
committed by Marshall Greenblatt
parent cf87c88b05
commit 1669c0afbd
49 changed files with 1098 additions and 1425 deletions

View File

@@ -0,0 +1,42 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "libcef/browser/printing/constrained_window_views_client.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/ui/browser_finder.h"
#include "components/web_modal/web_contents_modal_dialog_host.h"
namespace {
class CefConstrainedWindowViewsClient
: public constrained_window::ConstrainedWindowViewsClient {
public:
CefConstrainedWindowViewsClient() {}
~CefConstrainedWindowViewsClient() override {}
private:
// ConstrainedWindowViewsClient:
web_modal::ModalDialogHost* GetModalDialogHost(
gfx::NativeWindow parent) override {
NOTREACHED();
return nullptr;
}
gfx::NativeView GetDialogHostView(gfx::NativeWindow parent) override {
NOTREACHED();
return gfx::NativeView();
}
DISALLOW_COPY_AND_ASSIGN(CefConstrainedWindowViewsClient);
};
} // namespace
std::unique_ptr<constrained_window::ConstrainedWindowViewsClient>
CreateCefConstrainedWindowViewsClient() {
return base::WrapUnique(new CefConstrainedWindowViewsClient);
}