Initailize PrintViewManagerBasic for browser window.

This commit is contained in:
Cheng Zhao 2014-08-21 20:49:18 +08:00
parent c95869e515
commit 87d5b72b76
3 changed files with 4 additions and 14 deletions

View file

@ -29,6 +29,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "brightray/browser/inspectable_web_contents.h" #include "brightray/browser/inspectable_web_contents.h"
#include "brightray/browser/inspectable_web_contents_view.h" #include "brightray/browser/inspectable_web_contents_view.h"
#include "chrome/browser/printing/print_view_manager_basic.h"
#include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/invalidate_type.h" #include "content/public/browser/invalidate_type.h"
#include "content/public/browser/navigation_entry.h" #include "content/public/browser/navigation_entry.h"
@ -66,6 +67,8 @@ NativeWindow::NativeWindow(content::WebContents* web_contents,
weak_factory_(this), weak_factory_(this),
inspectable_web_contents_( inspectable_web_contents_(
brightray::InspectableWebContents::Create(web_contents)) { brightray::InspectableWebContents::Create(web_contents)) {
printing::PrintViewManagerBasic::CreateForWebContents(web_contents);
options.Get(switches::kFrame, &has_frame_); options.Get(switches::kFrame, &has_frame_);
options.Get(switches::kEnableLargerThanScreen, &enable_larger_than_screen_); options.Get(switches::kEnableLargerThanScreen, &enable_larger_than_screen_);

View file

@ -31,15 +31,6 @@
#include "printing/printed_document.h" #include "printing/printed_document.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#if defined(OS_WIN)
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
#endif
#if defined(ENABLE_FULL_PRINTING)
#include "chrome/browser/printing/print_error_dialog.h"
#endif
using base::TimeDelta; using base::TimeDelta;
using content::BrowserThread; using content::BrowserThread;
@ -182,10 +173,6 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
return; return;
} }
#if defined(ENABLE_FULL_PRINTING)
chrome::ShowPrintErrorDialog();
#endif
ReleasePrinterQuery(); ReleasePrinterQuery();
content::NotificationService::current()->Notify( content::NotificationService::current()->Notify(

View file

@ -395,7 +395,7 @@ PrintMsg_Print_Params CalculatePrintParamsForCss(
} }
bool IsPrintPreviewEnabled() { bool IsPrintPreviewEnabled() {
return true; return false;
} }
} // namespace } // namespace