Expose Print API to webContents and webView.

Also move the print implementation from window to webContents.
This commit is contained in:
Haojian Wu 2015-06-13 21:23:45 +08:00
parent 57580e00f9
commit 47eac062f6
11 changed files with 62 additions and 65 deletions

View file

@ -27,7 +27,6 @@
#include "base/strings/utf_string_conversions.h"
#include "brightray/browser/inspectable_web_contents.h"
#include "brightray/browser/inspectable_web_contents_view.h"
#include "chrome/browser/printing/print_view_manager_basic.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_details.h"
@ -96,8 +95,6 @@ NativeWindow::NativeWindow(content::WebContents* web_contents,
has_dialog_attached_(false),
zoom_factor_(1.0),
weak_factory_(this) {
printing::PrintViewManagerBasic::CreateForWebContents(web_contents);
InitWithWebContents(web_contents, this);
options.Get(switches::kFrame, &has_frame_);
@ -257,11 +254,6 @@ bool NativeWindow::IsDocumentEdited() {
void NativeWindow::SetMenu(ui::MenuModel* menu) {
}
void NativeWindow::Print(bool silent, bool print_background) {
printing::PrintViewManagerBasic::FromWebContents(GetWebContents())->
PrintNow(silent, print_background);
}
void NativeWindow::ShowDefinitionForSelection() {
NOTIMPLEMENTED();
}