Commit 40c10742 authored by noamsml@chromium.org's avatar noamsml@chromium.org

Move PDF to PWG conversion into PrivetLocalPrintOperationImpl

Change the format of the data provided to PrivetLocalPrintOperationImpl to
RefCountedBytes. Remove PrivetLocalPrintRequestPDF/PrivetLocalPrintRequestPWG.
Have users provide PDF data consistently, and do conversin in the
PrivetLocalPrintOperation.

BUG=318373

Review URL: https://codereview.chromium.org/73503002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235820 0039d316-1c4b-4281-b951-d872f2087c98
parent f32d9e5a
......@@ -9,8 +9,13 @@
#include "base/callback.h"
#include "chrome/browser/local_discovery/privet_url_fetcher.h"
#include "chrome/browser/local_discovery/pwg_raster_converter.h"
#include "net/base/host_port_pair.h"
namespace base {
class RefCountedBytes;
}
namespace local_discovery {
class PrivetHTTPClient;
......@@ -116,10 +121,6 @@ class PrivetLocalPrintOperation {
class Delegate {
public:
virtual ~Delegate() {}
virtual void OnPrivetPrintingRequestPDF(
const PrivetLocalPrintOperation* print_operation) = 0;
virtual void OnPrivetPrintingRequestPWGRaster(
const PrivetLocalPrintOperation* print_operation) = 0;
virtual void OnPrivetPrintingDone(
const PrivetLocalPrintOperation* print_operation) = 0;
virtual void OnPrivetPrintingError(
......@@ -130,12 +131,9 @@ class PrivetLocalPrintOperation {
virtual void Start() = 0;
// One of thsese should be called ONLY after |OnPrivetPrintingRequestPDF| or
// |OnPrivetPrintingRequestPWGRaster| are called on the delegate. Data should
// be in PDF or PWG format depending on what is requested by the local print
// operation.
virtual void SendData(const std::string& data) = 0;
virtual void SendDataFile(const base::FilePath& data) = 0;
// Required print data. MUST be called before calling |Start()|.
virtual void SetData(base::RefCountedBytes* data) = 0;
// Optional attributes for /submitdoc. Call before calling |Start()|
// |ticket| should be in CJT format.
......@@ -147,6 +145,10 @@ class PrivetLocalPrintOperation {
// to Google Cloud Print.
virtual void SetOffline(bool offline) = 0;
// For testing, inject an alternative PWG raster converter.
virtual void SetPWGRasterConverterForTesting(
scoped_ptr<PWGRasterConverter> pwg_raster_converter) = 0;
virtual PrivetHTTPClient* GetHTTPClient() = 0;
};
......
......@@ -5,6 +5,7 @@
#include "chrome/browser/local_discovery/privet_http_impl.h"
#include <algorithm>
#include <vector>
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
......@@ -368,6 +369,7 @@ PrivetLocalPrintOperationImpl::PrivetLocalPrintOperationImpl(
: privet_client_(privet_client), delegate_(delegate),
use_pdf_(false), has_capabilities_(false), has_extended_workflow_(false),
started_(false), offline_(false), invalid_job_retries_(0),
pwg_raster_converter_(PWGRasterConverter::CreateDefault()),
weak_factory_(this) {
}
......@@ -427,7 +429,7 @@ void PrivetLocalPrintOperationImpl::StartInitialRequest() {
// Since we have no capabiltties, the only reasonable format we can
// request is PWG Raster.
use_pdf_ = false;
delegate_->OnPrivetPrintingRequestPWGRaster(this);
StartConvertToPWG();
}
}
......@@ -489,18 +491,31 @@ void PrivetLocalPrintOperationImpl::DoSubmitdoc() {
url_fetcher_= privet_client_->CreateURLFetcher(
url, net::URLFetcher::POST, this);
std::string content_type =
use_pdf_ ? kPrivetContentTypePDF : kPrivetContentTypePWGRaster;
if (!use_pdf_) {
url_fetcher_->SetUploadFilePath(kPrivetContentTypePWGRaster,
pwg_file_path_);
} else {
// TODO(noamsml): Move to file-based upload data?
std::string data_str((const char*)data_->front(), data_->size());
url_fetcher_->SetUploadData(kPrivetContentTypePDF, data_str);
}
DCHECK(!data_.empty() || !data_file_.empty());
url_fetcher_->Start();
}
if (!data_file_.empty()) {
url_fetcher_->SetUploadFilePath(content_type, data_file_);
void PrivetLocalPrintOperationImpl::StartPrinting() {
if (has_extended_workflow_ && !ticket_.empty() && jobid_.empty()) {
DoCreatejob();
} else {
url_fetcher_->SetUploadData(content_type, data_);
DoSubmitdoc();
}
}
url_fetcher_->Start();
void PrivetLocalPrintOperationImpl::StartConvertToPWG() {
pwg_raster_converter_->Start(
data_,
base::Bind(&PrivetLocalPrintOperationImpl::OnPWGRasterConverted,
base::Unretained(this)));
}
void PrivetLocalPrintOperationImpl::OnCapabilitiesResponse(
......@@ -531,10 +546,11 @@ void PrivetLocalPrintOperationImpl::OnCapabilitiesResponse(
}
}
if (use_pdf_)
delegate_->OnPrivetPrintingRequestPDF(this);
else
delegate_->OnPrivetPrintingRequestPWGRaster(this);
if (use_pdf_) {
StartPrinting();
} else {
StartConvertToPWG();
}
}
void PrivetLocalPrintOperationImpl::OnSubmitdocResponse(
......@@ -566,7 +582,7 @@ void PrivetLocalPrintOperationImpl::OnSubmitdocResponse(
base::TimeDelta::FromSeconds(timeout));
} else if (use_pdf_ && error == kPrivetErrorInvalidDocumentType) {
use_pdf_ = false;
delegate_->OnPrivetPrintingRequestPWGRaster(this);
StartConvertToPWG();
} else {
delegate_->OnPrivetPrintingError(this, 200);
}
......@@ -594,6 +610,20 @@ void PrivetLocalPrintOperationImpl::OnCreatejobResponse(
DoSubmitdoc();
}
void PrivetLocalPrintOperationImpl::OnPWGRasterConverted(
bool success,
const base::FilePath& pwg_file_path) {
if (!success) {
delegate_->OnPrivetPrintingError(this, -1);
return;
}
DCHECK(!pwg_file_path.empty());
pwg_file_path_ = pwg_file_path;
StartPrinting();
}
PrivetHTTPClient* PrivetLocalPrintOperationImpl::GetHTTPClient() {
return privet_client_;
}
......@@ -618,21 +648,9 @@ void PrivetLocalPrintOperationImpl::OnNeedPrivetToken(
privet_client_->RefreshPrivetToken(callback);
}
void PrivetLocalPrintOperationImpl::SendData(const std::string& data) {
DCHECK(started_);
DCHECK(data_file_.empty());
void PrivetLocalPrintOperationImpl::SetData(base::RefCountedBytes* data) {
DCHECK(!started_);
data_ = data;
SendDataInternal();
}
void PrivetLocalPrintOperationImpl::SendDataFile(
const base::FilePath& data_file) {
DCHECK(started_);
DCHECK(data_.empty());
data_file_ = data_file;
SendDataInternal();
}
void PrivetLocalPrintOperationImpl::SetTicket(const std::string& ticket) {
......@@ -655,12 +673,9 @@ void PrivetLocalPrintOperationImpl::SetOffline(bool offline) {
offline_ = offline;
}
void PrivetLocalPrintOperationImpl::SendDataInternal() {
if (has_extended_workflow_ && !ticket_.empty() && jobid_.empty()) {
DoCreatejob();
} else {
DoSubmitdoc();
}
void PrivetLocalPrintOperationImpl::SetPWGRasterConverterForTesting(
scoped_ptr<PWGRasterConverter> pwg_raster_converter) {
pwg_raster_converter_ = pwg_raster_converter.Pass();
}
PrivetHTTPClientImpl::PrivetHTTPClientImpl(
......
......@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/file_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/local_discovery/privet_http.h"
......@@ -156,8 +157,7 @@ class PrivetLocalPrintOperationImpl
virtual ~PrivetLocalPrintOperationImpl();
virtual void Start() OVERRIDE;
virtual void SendData(const std::string& data) OVERRIDE;
virtual void SendDataFile(const base::FilePath& data) OVERRIDE;
virtual void SetData(base::RefCountedBytes* data) OVERRIDE;
virtual void SetTicket(const std::string& ticket) OVERRIDE;
......@@ -167,6 +167,9 @@ class PrivetLocalPrintOperationImpl
virtual void SetOffline(bool offline) OVERRIDE;
virtual void SetPWGRasterConverterForTesting(
scoped_ptr<PWGRasterConverter> pwg_raster_converter) OVERRIDE;
virtual PrivetHTTPClient* GetHTTPClient() OVERRIDE;
virtual void OnError(PrivetURLFetcher* fetcher,
......@@ -190,14 +193,16 @@ class PrivetLocalPrintOperationImpl
void DoCreatejob();
void DoSubmitdoc();
void StartConvertToPWG();
void StartPrinting();
void OnCapabilitiesResponse(bool has_error,
const base::DictionaryValue* value);
void OnSubmitdocResponse(bool has_error,
const base::DictionaryValue* value);
void OnCreatejobResponse(bool has_error,
const base::DictionaryValue* value);
void SendDataInternal();
void OnPWGRasterConverted(bool success, const base::FilePath& pwg_file_path);
PrivetHTTPClientImpl* privet_client_;
PrivetLocalPrintOperation::Delegate* delegate_;
......@@ -205,8 +210,8 @@ class PrivetLocalPrintOperationImpl
ResponseCallback current_response_;
std::string ticket_;
std::string data_;
base::FilePath data_file_;
scoped_refptr<base::RefCountedBytes> data_;
base::FilePath pwg_file_path_;
bool use_pdf_;
bool has_capabilities_;
......@@ -223,6 +228,7 @@ class PrivetLocalPrintOperationImpl
scoped_ptr<PrivetURLFetcher> url_fetcher_;
scoped_ptr<PrivetInfoOperation> info_operation_;
scoped_ptr<PWGRasterConverter> pwg_raster_converter_;
base::WeakPtrFactory<PrivetLocalPrintOperationImpl> weak_factory_;
};
......
......@@ -379,20 +379,6 @@ class MockLocalPrintDelegate : public PrivetLocalPrintOperation::Delegate {
MockLocalPrintDelegate() {}
~MockLocalPrintDelegate() {}
virtual void OnPrivetPrintingRequestPDF(
const PrivetLocalPrintOperation* print_operation) {
OnPrivetPrintingRequestPDFInternal();
}
MOCK_METHOD0(OnPrivetPrintingRequestPDFInternal, void());
virtual void OnPrivetPrintingRequestPWGRaster(
const PrivetLocalPrintOperation* print_operation) {
OnPrivetPrintingRequestPWGRasterInternal();
}
MOCK_METHOD0(OnPrivetPrintingRequestPWGRasterInternal, void());
virtual void OnPrivetPrintingDone(
const PrivetLocalPrintOperation* print_operation) {
OnPrivetPrintingDoneInternal();
......@@ -408,6 +394,26 @@ class MockLocalPrintDelegate : public PrivetLocalPrintOperation::Delegate {
MOCK_METHOD1(OnPrivetPrintingErrorInternal, void(int http_code));
};
// A note on PWG raster conversion: The PWG raster converter used simply
// converts strings to file paths based on them by appending "test.pdf", since
// it's easier to test that way. Instead of using a mock, we simply check if the
// request is uploading a file that is based on this pattern.
class FakePWGRasterConverter : public PWGRasterConverter {
public:
FakePWGRasterConverter() {
}
virtual ~FakePWGRasterConverter() {
}
virtual void Start(base::RefCountedBytes* data,
const ResultCallback& callback) OVERRIDE {
std::string data_str((const char*)data->front(), data->size());
callback.Run(true, base::FilePath().AppendASCII(data_str + "test.pdf"));
}
};
class PrivetInfoTest : public PrivetHTTPTest {
public:
PrivetInfoTest() {}
......@@ -782,6 +788,17 @@ class PrivetLocalPrintTest : public PrivetHTTPTest {
virtual void SetUp() OVERRIDE {
local_print_operation_ = privet_client_->CreateLocalPrintOperation(
&local_print_delegate_);
local_print_operation_->SetPWGRasterConverterForTesting(
scoped_ptr<PWGRasterConverter>(new FakePWGRasterConverter));
}
scoped_refptr<base::RefCountedBytes> RefCountedBytesFromString(
std::string str) {
std::vector<unsigned char> str_vec;
str_vec.insert(str_vec.begin(), str.begin(), str.end());
return scoped_refptr<base::RefCountedBytes>(
base::RefCountedBytes::TakeVector(&str_vec));
}
protected:
......@@ -792,20 +809,18 @@ class PrivetLocalPrintTest : public PrivetHTTPTest {
TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrint) {
local_print_operation_->SetUsername("sample@gmail.com");
local_print_operation_->SetJobname("Sample job name");
local_print_operation_->SetData(RefCountedBytesFromString(
"Sample print data"));
local_print_operation_->Start();
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/info"),
kSampleInfoResponse));
EXPECT_CALL(local_print_delegate_, OnPrivetPrintingRequestPDFInternal());
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/capabilities"),
kSampleCapabilitiesResponse));
local_print_operation_->SendData("Sample print data");
EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
// TODO(noamsml): Is encoding spaces as pluses standard?
......@@ -819,20 +834,18 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrint) {
TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithAnyMimetype) {
local_print_operation_->SetUsername("sample@gmail.com");
local_print_operation_->SetJobname("Sample job name");
local_print_operation_->SetData(
RefCountedBytesFromString("Sample print data"));
local_print_operation_->Start();
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/info"),
kSampleInfoResponse));
EXPECT_CALL(local_print_delegate_, OnPrivetPrintingRequestPDFInternal());
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/capabilities"),
kSampleCapabilitiesResponseWithAnyMimetype));
local_print_operation_->SendData("Sample print data");
EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
// TODO(noamsml): Is encoding spaces as pluses standard?
......@@ -846,29 +859,25 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithAnyMimetype) {
TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrint) {
local_print_operation_->SetUsername("sample@gmail.com");
local_print_operation_->SetJobname("Sample job name");
local_print_operation_->SetData(
RefCountedBytesFromString("path/to/"));
local_print_operation_->Start();
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/info"),
kSampleInfoResponse));
EXPECT_CALL(local_print_delegate_,
OnPrivetPrintingRequestPWGRasterInternal());
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/capabilities"),
kSampleCapabilitiesResponsePWGOnly));
local_print_operation_->SendDataFile(
base::FilePath(FILE_PATH_LITERAL("sample/file/path")));
EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
// TODO(noamsml): Is encoding spaces as pluses standard?
EXPECT_TRUE(SuccessfulResponseToURLAndFilePath(
GURL("http://10.0.0.8:6006/privet/printer/submitdoc?"
"user=sample%40gmail.com&jobname=Sample+job+name"),
base::FilePath(FILE_PATH_LITERAL("sample/file/path")),
base::FilePath(FILE_PATH_LITERAL("path/to/test.pdf")),
kSampleLocalPrintResponse));
};
......@@ -876,20 +885,18 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithCreatejob) {
local_print_operation_->SetUsername("sample@gmail.com");
local_print_operation_->SetJobname("Sample job name");
local_print_operation_->SetTicket("Sample print ticket");
local_print_operation_->SetData(
RefCountedBytesFromString("Sample print data"));
local_print_operation_->Start();
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/info"),
kSampleInfoResponseWithCreatejob));
EXPECT_CALL(local_print_delegate_, OnPrivetPrintingRequestPDFInternal());
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/capabilities"),
kSampleCapabilitiesResponse));
local_print_operation_->SendData("Sample print data");
EXPECT_TRUE(SuccessfulResponseToURLAndData(
GURL("http://10.0.0.8:6006/privet/printer/createjob"),
"Sample print ticket",
......@@ -909,43 +916,36 @@ TEST_F(PrivetLocalPrintTest, PDFPrintInvalidDocumentTypeRetry) {
local_print_operation_->SetUsername("sample@gmail.com");
local_print_operation_->SetJobname("Sample job name");
local_print_operation_->SetTicket("Sample print ticket");
local_print_operation_->SetData(
RefCountedBytesFromString("sample/path/"));
local_print_operation_->Start();
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/info"),
kSampleInfoResponseWithCreatejob));
EXPECT_CALL(local_print_delegate_, OnPrivetPrintingRequestPDFInternal());
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/capabilities"),
kSampleCapabilitiesResponse));
local_print_operation_->SendData("Sample print data");
EXPECT_TRUE(SuccessfulResponseToURLAndData(
GURL("http://10.0.0.8:6006/privet/printer/createjob"),
"Sample print ticket",
kSampleCreatejobResponse));
EXPECT_CALL(local_print_delegate_,
OnPrivetPrintingRequestPWGRasterInternal());
// TODO(noamsml): Is encoding spaces as pluses standard?
EXPECT_TRUE(SuccessfulResponseToURLAndData(
GURL("http://10.0.0.8:6006/privet/printer/submitdoc?"
"user=sample%40gmail.com&jobname=Sample+job+name&job_id=1234"),
"Sample print data",
"sample/path/",
kSampleInvalidDocumentTypeResponse));
local_print_operation_->SendData("Sample print data2");
EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
EXPECT_TRUE(SuccessfulResponseToURLAndData(
EXPECT_TRUE(SuccessfulResponseToURLAndFilePath(
GURL("http://10.0.0.8:6006/privet/printer/submitdoc?"
"user=sample%40gmail.com&jobname=Sample+job+name&job_id=1234"),
"Sample print data2",
base::FilePath(FILE_PATH_LITERAL("sample/path/test.pdf")),
kSampleLocalPrintResponse));
};
......@@ -953,20 +953,18 @@ TEST_F(PrivetLocalPrintTest, LocalPrintRetryOnInvalidJobID) {
local_print_operation_->SetUsername("sample@gmail.com");
local_print_operation_->SetJobname("Sample job name");
local_print_operation_->SetTicket("Sample print ticket");
local_print_operation_->SetData(
RefCountedBytesFromString("Sample print data"));
local_print_operation_->Start();
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/info"),
kSampleInfoResponseWithCreatejob));
EXPECT_CALL(local_print_delegate_, OnPrivetPrintingRequestPDFInternal());
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/capabilities"),
kSampleCapabilitiesResponse));
local_print_operation_->SendData("Sample print data");
EXPECT_TRUE(SuccessfulResponseToURLAndData(
GURL("http://10.0.0.8:6006/privet/printer/createjob"),
"Sample print ticket",
......
// Copyright 2013 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 "chrome/browser/local_discovery/pwg_raster_converter.h"
namespace local_discovery {
class PWGRasterConverterImpl : public PWGRasterConverter {
public:
PWGRasterConverterImpl();
virtual ~PWGRasterConverterImpl();
virtual void Start(base::RefCountedBytes* data,
const ResultCallback& callback) OVERRIDE;
};
// static
scoped_ptr<PWGRasterConverter> PWGRasterConverter::CreateDefault() {
return scoped_ptr<PWGRasterConverter>(new PWGRasterConverterImpl());
}
PWGRasterConverterImpl::PWGRasterConverterImpl() {
}
PWGRasterConverterImpl::~PWGRasterConverterImpl() {
}
void PWGRasterConverterImpl::Start(base::RefCountedBytes* data,
const ResultCallback& callback) {
NOTIMPLEMENTED();
}
} // namespace local_discovery
// Copyright 2013 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.
#ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PWG_RASTER_CONVERTER_H_
#define CHROME_BROWSER_LOCAL_DISCOVERY_PWG_RASTER_CONVERTER_H_
#include "base/callback.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_memory.h"
namespace base {
class FilePath;
}
namespace local_discovery {
class PWGRasterConverter {
public:
// Callback for when the PDF is converted to a PWG raster.
// |success| denotes whether the conversion succeeded.
// |temp_file| is the path to the temp file (owned by the converter) that
// contains the PWG raster data.
typedef base::Callback<void(bool /*success*/,
const base::FilePath& /*temp_file*/)>
ResultCallback;
virtual ~PWGRasterConverter() {}
static scoped_ptr<PWGRasterConverter> CreateDefault();
virtual void Start(base::RefCountedBytes* data,
const ResultCallback& callback) = 0;
};
} // namespace local_discovery
#endif // CHROME_BROWSER_LOCAL_DISCOVERY_PWG_RASTER_CONVERTER_H_
......@@ -1422,10 +1422,19 @@ void PrintPreviewHandler::StartPrivetLocalPrint(
privet_local_print_operation_->SetTicket(print_ticket);
PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
web_ui()->GetController());
scoped_refptr<base::RefCountedBytes> data;
string16 title;
if (!GetPreviewDataAndTitle(&data, &title)) {
base::FundamentalValue http_code_value(-1);
web_ui()->CallJavascriptFunction("onPrivetPrintFailed", http_code_value);
return;
}
privet_local_print_operation_->SetJobname(
base::UTF16ToUTF8(print_preview_ui->initiator_title()));
base::UTF16ToUTF8(title));
privet_local_print_operation_->SetData(data);
Profile* profile = Profile::FromWebUI(web_ui());
SigninManagerBase* signin_manager =
......@@ -1513,28 +1522,6 @@ bool PrintPreviewHandler::CreatePrivetHTTP(
return true;
}
void PrintPreviewHandler::OnPrivetPrintingRequestPDF(
const local_discovery::PrivetLocalPrintOperation* print_operation) {
scoped_refptr<base::RefCountedBytes> data;
string16 title;
if (!GetPreviewDataAndTitle(&data, &title)) {
base::FundamentalValue http_code_value(-1);
web_ui()->CallJavascriptFunction("onPrivetPrintFailed", http_code_value);
return;
}
// TODO(noamsml): Move data into request without copying it?
std::string data_str((const char*)data->front(), data->size());
privet_local_print_operation_->SendData(data_str);
}
void PrintPreviewHandler::OnPrivetPrintingRequestPWGRaster(
const local_discovery::PrivetLocalPrintOperation* print_operation) {
NOTIMPLEMENTED();
}
void PrintPreviewHandler::OnPrivetPrintingDone(
const local_discovery::PrivetLocalPrintOperation* print_operation) {
ClosePreviewDialog();
......
......@@ -45,8 +45,7 @@ class PrintPreviewHandler
public local_discovery::PrivetLocalPrintOperation::Delegate,
#endif
public ui::SelectFileDialog::Listener,
public printing::PrintViewManagerObserver
{
public printing::PrintViewManagerObserver {
public:
PrintPreviewHandler();
virtual ~PrintPreviewHandler();
......@@ -94,12 +93,6 @@ class PrintPreviewHandler
const base::DictionaryValue* capabilities) OVERRIDE;
// PrivetLocalPrintOperation::Delegate implementation.
virtual void OnPrivetPrintingRequestPDF(
const local_discovery::PrivetLocalPrintOperation*
print_operation) OVERRIDE;
virtual void OnPrivetPrintingRequestPWGRaster(
const local_discovery::PrivetLocalPrintOperation*
print_operation) OVERRIDE;
virtual void OnPrivetPrintingDone(
const local_discovery::PrivetLocalPrintOperation*
print_operation) OVERRIDE;
......
......@@ -982,6 +982,8 @@
'browser/local_discovery/privet_local_printer_lister.cc',
'browser/local_discovery/privet_url_fetcher.cc',
'browser/local_discovery/privet_url_fetcher.h',
'browser/local_discovery/pwg_raster_converter.cc',
'browser/local_discovery/pwg_raster_converter.h',
'browser/local_discovery/service_discovery_client_mac.h',
'browser/local_discovery/service_discovery_client_mac.mm',
'browser/local_discovery/service_discovery_client_mac_factory.h',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment