Setup PrintingMessageFilter for printing.

This commit is contained in:
Cheng Zhao 2014-08-21 21:19:43 +08:00
parent 11b9a06639
commit eb3ecab6a8
4 changed files with 10 additions and 7 deletions

View file

@ -10,6 +10,7 @@
#include "atom/browser/atom_resource_dispatcher_host_delegate.h"
#include "atom/browser/native_window.h"
#include "atom/browser/window_list.h"
#include "chrome/browser/printing/printing_message_filter.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
@ -48,6 +49,11 @@ AtomBrowserClient::AtomBrowserClient()
AtomBrowserClient::~AtomBrowserClient() {
}
void AtomBrowserClient::RenderProcessWillLaunch(
content::RenderProcessHost* host) {
host->AddFilter(new PrintingMessageFilter(host->GetID()));
}
void AtomBrowserClient::ResourceDispatcherHostCreated() {
resource_dispatcher_delegate_.reset(new AtomResourceDispatcherHostDelegate);
content::ResourceDispatcherHost::Get()->SetDelegate(

View file

@ -20,6 +20,8 @@ class AtomBrowserClient : public brightray::BrowserClient {
protected:
// content::ContentBrowserClient:
virtual void RenderProcessWillLaunch(
content::RenderProcessHost* host) OVERRIDE;
virtual void ResourceDispatcherHostCreated() OVERRIDE;
virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,